11 important array methods in JavaScript

Pubblicato il: 19 luglio 2021
sul canale di: 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...


In questa pagina del sito puoi guardare il video online 11 important array methods in JavaScript della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Merdi Kim 19 luglio 2021, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 30 volte e gli è piaciuto 5 spettatori. Buona visione!