Let's understand javascript array functions and how to use them.
Array.map()
Returns a new array with the results of calling a...
For further actions, you may consider blocking this person and/or reporting abuse
Array flat example has a wrong result.
Applying
Array.flat()
without any value will only flat a provided array up to one level. In the provided example you have an array with 2 nesting levels. Thus, the result should be[1, 2, 3, 4, [5, 6]]
.If you know the number of nesting arrays you can provide it (e.g.
list.flat(2)
), otherwise you can use global propertyInfinity
with it (e.g.list.flat(Infinity)
) which will flat all number of nesting arrays.Thus your example might be rewritten in the following way
My bad, Thank you so much for pointing it out.
As previously mentioned, these are not hacks. Might also be a good idea to give working code samples, instead of ones with emojis that give errors.
Thanks for the suggestion, Emojis will work if use as string '😊'.
But not as variable names
I've also add code snippets, hope that helps.
Cool article, but poorly named. These just aren't hacks.
Thanks for the suggestion
Nice article, the emoji's are bad for me, sorry.
Thanks, I've also add code snippets, hope that helps.
It is man, Good job ! (:
Love it!! Thanks for sharing
Good idea, adding emojis worked for me, it was also clear and simple. Thanks for posting.
Dear Rahul Sharma,may I translate your all dev articles into Chinese?I would like to share it with more developers in China. I will give the original author and original source.
Sure, you can don't forget to add original author and original source.
Interesting. One can read the code with emojis very fast. Very good idea :)
At only one glance I got all the methods. It's really awesome 👌. Unique concept of explaining with emojis.
Helped me a lot, thanks for sharing 🙌
Good text.
I'm new in developing, and your article saved me a lot of time. I save it to my bookmarks)
I'm trying to find a job offer for React js, could you please take a look if those questions keenethics.com/blog/react-intervie... for interview are actual?
@katesoft8 Check this, It might help github.com/sudheerj/reactjs-interv...
Useful cheat sheet, emojis are so funny to show off these functions. Thanks for sharing.
A two-dimensional array example for each section will be useful. No one deals with a single dimension array in real life
A somewhat shorter sheet:
array-methods.github.io
Since when copying documentation is a Cheat Sheet?
In Cheat Sheet methods should be grouped and seen in one screen.
Cool. Prepared like this it should be easy to find a #react job on reactjsjob.com or javascriptjob.xyz
How come these are hacks? These are in built JavaScript methods available on mozilla JavaScript documentation as well.
I've already updated the title.
Otherwise, I would love if you'll go to check out my last article and give me an advise or any tips on changes.