9 Tweets 2 reads Apr 18, 2023
JavaScript's developers must know these 6 functions:
1. shift()
β€” The shift() method removes the first element from an array and returns the removed element. This method changes the length of the array.
2. unshift()
β€” Just like shift() methods removes the first element from an array, unshift() adds it. This method changes the length of the array and returns the new length.
3. slice()
β€” The slice() method returns a shallow copy of a portion of an array into a new array object selected from start to end, where start and end represent the index of items in that array. The original array will not be modified.
4. splice()
β€” The splice() start at index 2 (the third place, count starts from 0) of the array, and remove one item.
In our array, that would mean that β€œrabbit” got removed. splice() will returns new array as result.
5. includes()
β€” includes() will check every item in the array, and check if any of them includes our condition. It will return boolean.
6. reverse()
β€” reverse() method reverses an array. Be careful since reverse() is destructive, which means it changes the original array.
You can get my free JavaScript e-book that has 100+ free resources.
πŸ”— haiderkh1.gumroad.com
That's a wrap!
If you enjoyed this thread:
1. Follow me @slow_developer for more of these
2. RT the tweet below to share this thread with your audience

Loading suggestions...