11 important array methods in JavaScript

Publié le: 19 juillet 2021
sur la chaîne: Merdi Kim
30
5

Arrays are one of the most used elements in JavaScript. Today I’m covering 11 arrays methods that will help you work more effectively.
1. join() method : this method joins all the elements of the array and returns a string
2. push() method : this method adds a specific element at the end of the array
3. pop() method : this method removes the last element of an array
4. sort() method: this method arranges all the elements of the array in an ascending of descending way
5. forEach() method: this method goes through the entire array and does something to each element of the array without returning anything
6. map() method: this method is similar to the forEach method but the difference is that this map() method returns a new array after applying something to all the elements of that array
7. slice method (): this method cuts a certain part of an array and returns that part in a new array
8. shift method () : this method removes the first element of an array
9. unshift method (): this method adds an element at the beginning of the array
10. indexOf method (): this method checks for the location of a specific element in the array and returns its position or -1 if the element is not found
11. Find method (): this method goes through the array and tries to find a specific element, if found it returns that element, or that first element that matches the search , if there is no element, it returns undefined .

If you want to know more about arrays and array methods , definitely check this website 👉👉 https://developer.mozilla.org/en-US/d...


Sur cette page du site, vous pouvez voir la vidéo en ligne 11 important array methods in JavaScript durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Merdi Kim 19 juillet 2021, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 30 fois et il a aimé 5 téléspectateurs. Bon visionnage!