LeCoupa / awesome-cheatsheets

👩‍💻👨‍💻 Awesome cheatsheets for popular programming languages, frameworks and development tools. They include everything you should know in one single file.
https://lecoupa.github.io/awesome-cheatsheets/
MIT License
38.36k stars 6k forks source link

added arr. methods to Javascript #342

Open FarhadIbrahimov opened 11 months ago

FarhadIbrahimov commented 11 months ago

// Instance: iteration methods arr[@@iterator]() // Returns a new Array Iterator object that contains the values for each index in the array. (Same as arr.values())

// Instance: accessor methods arr.flat(depth) // Creates a new array with all sub-array elements concatenated up to the specified depth.

// Instance: mutator methods arr.populate(length, value) // Fills the array with the specified value to a given length. arr.shuffle() // Randomly shuffles the elements of the array in place.

// Instance: utility methods arr.isEmpty() // Checks if the array is empty and returns a boolean value. arr.sample() // Returns a random element from the array without modifying the array.