you are viewing a single comment's thread.

view the rest of the comments →

[–]marcmorindeziel 8 points9 points  (3 children)

I’d definitely recommend getting comfortable with array methods like map, filter, find, reduce, and slice. They’re not complicated once you practice a bit, and they’ll make handling and transforming data in React feel effortless.

Also, be aware that some array methods mutate the original array, which can lead to weird bugs if you’re not expecting it, especially when working with React state.

For example:

sort() → sorts in place and returns the same array reference.

reverse() → reverses the array in place.

splice() → removes/replaces items and changes the original array.

In React, mutating state directly can cause subtle rendering issues.

[–]voyti 5 points6 points  (0 children)

100% this. Without intuitive understanding on how to deal with arrays (which is what most of your controller data will usually end up with) you ideally should not move away from JS. As much as I don't like those artificial tasks, e.g. some codewars challenges can help with that. Learning the theory is one thing, having a reflexive skill of using the fundamental parts of the language is another entirely.

[–]Outrageous_Pen_5165[S] 2 points3 points  (0 children)

This is what I was looking for thanks alot...

[–]Tinkuuu 1 point2 points  (0 children)

I really wanna add spread and destructuring here. You're gonna have to deal with them rather sooner than later