Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added arr. methods to Javascript #342

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FarhadIbrahimov
Copy link

// 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant