Erick Wendel Profile picture
Aug 4, 2022 11 tweets 4 min read Read on X
wow JavaScript is on 🔥with a lot of new functions for Arrays in progress 🤯😬 Welcome Immutability, Grouping, and Async helpers ❤️

🧵 /1 Image
I'd say JavaScript makes my work as a content creator so easy sometimes 😂

There are so many new proposals and new features coming to the language that we could discuss a whole week about it haha.

/2
Today, I brought something interesting that I was missing for a while: Immutability in arrays!

/3
Did you know that most of the common functions in Arrays actually mutate their values?

const items = [ 1, 3, 2 ]

items.sort() // [1, 2, 3]
items // the value was actually changed by [1, 2, 3]

items.reverse() // [3, 2, 1]
items // now it's [3 , 2, 1]

/4
Or even worse, when you want to remove an item for a specific task using .splice (not .slice) and the whole list is affected:

items.splice(2, 2) // [ 1 ]
items // now it lost all items and kept only [ 1 ]

/5
The "Change Array by copy" proposal provides additional methods on Array.prototype to enable changes on the array by returning a new copy of it with the change.

Using the new set o features, the actual array won't change when you perform that kind of task 🤯❤️

/6
Not just to "fix" the language it has feature proposals but also to extend functionalities.

/7
I remember trying to group values on an object by doing the following:

let mapped = { even: [], odd: [] }
;[0, 1, 2, 3].forEach(num => num % 2 == 0 ?
mapped.even.push(num) :
mapped.odd.push(num)
)
mapped
// { even: [ 0, 2 ], odd: [ 1, 3 ] }

/8
Using the "Array Grouping" proposal you'd write everything on a single line:

[0, 1, 2, 3].group(num => num % 2 === 0 ? 'even' : 'odd');
// { even: [ 0, 2 ], odd: [ 1, 3 ] }

How amazing is it?🤩🤯

/9
And last, but not least, the "Array.fromAsync" proposal came to help us build arrays from Async Iterators 😬🤯

All of these features you can find on the @TC39 website and GitHub repo to follow the progress and the expected dates for them to finally become part of the lang

/10
Tell me here in the comments, what feature did you like most? What kind of function do you think JavaScript is still missing?

#javascript #tc39 #educators #100daysofcodechallenge #newfeatures #js #ecmascript #tipsandtricks /11

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Erick Wendel

Erick Wendel Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @erickwendel_

Mar 9, 2023
Melhorar a performance de aplicações não deveria ser algo incrível 👀🥵

🧵/1

#developer #softwaredeveloper #developertips #developerstories
Sim, eu acredito que deveria ser o básico!

Em 99% das empresas que trabalhei, a preocupação sempre era "faz funcionar agora e depois melhoramos"

/2
E a real é que isso NUNCA aconteceu e todos os problemas que o time previa que ia acontecer, aconteciam e os projetos se tornavam um caos

/3
Read 12 tweets
Mar 8, 2023
Resolvi um novo bug crítico no @nodejs core com apenas UMA LINHA de código🤯 (e 30 linhas de testes 🥳)

🧵/1

#javascript #opensource #nodejs #js #streams #nodejsstreams #javascriptstreams Image
Ontem saiu o Node.js v18.15 com uma pancada de coisas legais e esse bug eu havia corrigido no 19 e finalmente ele veio para a versão LTS

Pra mim, essa é a prova de que quantidade de código não tem nada a ver com produção ou impacto

/2
Qual era o problema?

As Node.js Streams são parte do Node.js desde o início e muita coisa interna do Node.js as usa para controlar eventos e processar dados sob demanda

/3
Read 13 tweets
Mar 7, 2023
E olha que demaaaaaais! Vou trazer o Head de Machine learning para a Web do @Google falar lá no canal 🤯🥳

➳ já marca na agenda ai: bit.ly/live-ml-for-we…

🧵/1

#machinelearning #criatividade #ai #javascript #tensorflowjs #tensorflow #chromedevelopers #google Image
Quem participou da #SemanaJSExpert, viu mágicas para rodar reconhecimento de gestos, objetos e mais direto do navegador

Mas, eu sou só alguem curioso tentando exercitar a minha criatividade

Já o @jason_mayes é do time responsável pelo @TensorFlow js no Google

/2
Ele fez um super treinamento no canal da @googledevs sobre Machine Learning para Web e eu pessoalmente aprendi muita coisa por lá!

O nosso encontro vai acontecer no dia 10/03 às 15:30 (horário de Brasília), vem que a parada vai ser inédita!

/3
Read 5 tweets
Jan 26, 2023
Será que implementar testes automatizados é tão demorado e custoso como falam? 😬

🧵/1

#javascript #testautomation #testing #qa #qualityassurance #developerstories #carreira #desenvolvimentodesoftware
Já comenta aqui abaixo, você cria testes automatizados para todas as tarefas que entrega?

/2
Uma aluna recentemente começou um trabalho e se deparou com o ambiente de desenvolvimento bem caótico

Má gestão dos projetos, tarefas que ja nascem atrasadas e muito retrabalho 😥

/3
Read 10 tweets
Jan 25, 2023
Wowwwwww today is a day to celebrate! My blog is finally live and the first post is CRAZY nice 😱🔥

👉🏻 bit.ly/blog-ew-websoc…

🧵/1

#javascript #nodejs #learning #blogpost #tutorial #websockets #socketio #diy #100daysofcode Image
I've been creating videos on my youtube channel that you rarely will see in another place on the internet 🤩

You'll find there subjects like Recreating @nodejs from scratch, Web APIs and recreating web protocols such as the Web Socket using JS with no frameworks, etc

/2
And others, which are amazing experiments, such as recreating a code coverage tool from scratch and how to process terabytes of data using JavaScript

If you search about those subjects you'd reach out to my videos but why not have them as blog posts as well?

/3
Read 5 tweets
Jan 24, 2023
Sabia que é possível usar JavaScript para interpretar variáveis do bash direto do terminal? 🤯🔥

🧵/1

#javascript #nodejs #js #bash #devtips #100daysofcode #node #childprocess #tutorial Image
Estava produzindo uma super aula do meu curso de Node.js Streams (em inglês), ensinando sobre como paralelizar o processamento de arquivos usando Node.js

A ideia é subir um processo para cada arquivo, e cada processo filtra os usuários que possuem o email em dominio gmail

/2
Só que eu automatizei a validação para verificar que todos os itens foram processados e enviados para um arquivo de saida

Então primeiro fui lá e usei o `grep` para filtrar o texto do arquivo e o `wc -l`, para obter a quantidade de linhas.

/3
Read 8 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(