The document describes various methods available for arrays and strings in JavaScript. For arrays, it lists methods such as concat(), copyWithin(), every(), flat(), flatMap(), fill(), from(), find(), findIndex(), forEach(), includes(), indexOf(), isArray(), join(), keys(), map(), of(), pop(), push(), reverse(), some(), shift(), slice(), sort(), splice(), unshift(), and values(). It also compares the shift() and pop() methods. For strings, it lists methods such as charAt(), concat(), indexOf(), lastIndexOf(), slice(), toLowerCase(), toUpperCase(), valueOf(), split(), and trim().
The document describes various methods available for arrays and strings in JavaScript. For arrays, it lists methods such as concat(), copyWithin(), every(), flat(), flatMap(), fill(), from(), find(), findIndex(), forEach(), includes(), indexOf(), isArray(), join(), keys(), map(), of(), pop(), push(), reverse(), some(), shift(), slice(), sort(), splice(), unshift(), and values(). It also compares the shift() and pop() methods. For strings, it lists methods such as charAt(), concat(), indexOf(), lastIndexOf(), slice(), toLowerCase(), toUpperCase(), valueOf(), split(), and trim().
The document describes various methods available for arrays and strings in JavaScript. For arrays, it lists methods such as concat(), copyWithin(), every(), flat(), flatMap(), fill(), from(), find(), findIndex(), forEach(), includes(), indexOf(), isArray(), join(), keys(), map(), of(), pop(), push(), reverse(), some(), shift(), slice(), sort(), splice(), unshift(), and values(). It also compares the shift() and pop() methods. For strings, it lists methods such as charAt(), concat(), indexOf(), lastIndexOf(), slice(), toLowerCase(), toUpperCase(), valueOf(), split(), and trim().
The document describes various methods available for arrays and strings in JavaScript. For arrays, it lists methods such as concat(), copyWithin(), every(), flat(), flatMap(), fill(), from(), find(), findIndex(), forEach(), includes(), indexOf(), isArray(), join(), keys(), map(), of(), pop(), push(), reverse(), some(), shift(), slice(), sort(), splice(), unshift(), and values(). It also compares the shift() and pop() methods. For strings, it lists methods such as charAt(), concat(), indexOf(), lastIndexOf(), slice(), toLowerCase(), toUpperCase(), valueOf(), split(), and trim().
Download as DOCX, PDF, TXT or read online from Scribd
Download as docx, pdf, or txt
You are on page 1of 6
ARRAY
• concat() It returns a new array object that
contains two or more merged arrays.
• copywithin() It copies the part of the given
array with its own elements and returns the modified array.
• every()It determines whether all the
elements of an array are satisfying the provided function conditions.
• flat() It creates a new array carrying sub-
array elements concatenated recursively till the specified depth.
• flatMap() It maps all array elements via
mapping function, then flattens the result into a new array.
• fill() It fills elements into an array with
static values. • from() It creates a new array carrying the exact copy of another array element.
• find() It returns the value of the first
element in the given array that satisfies the specified condition.
• findIndex()It returns the index value of the
first element in the given array that satisfies the specified condition.
• forEach() It invokes the provided function
once for each element of an array.
• includes() It checks whether the given array
contains the specified element.
• indexOf() It searches the specified element
in the given array and returns the index of the first match.
• isArray() It tests if the passed value ia an
array.
• join() It joins the elements of an array as a
string.
• keys() It creates an iterator object that
contains only the keys of the array, then loops through these keys. • map() It calls the specified function for every array element and returns the new array
• of()It creates a new array from a variable
number of arguments, holding any type of argument.
• pop() It removes and returns the last
element of an array.
• push() It adds one or more elements to the
end of an array.
• reverse() It reverses the elements of given
array.
• some() It determines if any element of the
array passes the test of the implemented function. • shift() It removes and returns the first element of an array.
• slice() It returns a new array containing the
copy of the part of the given array.
• sort() It returns the element of the given
array in a sorted order.
• splice()It add/remove elements to/from the
given array.
• unshift() It adds one or more elements in
the beginning of the given array.
• values() It creates a new iterator object
carrying values for each index in the array. • length() it determine the no of elements in array
• Shift() Vs pop() Method in JavaScript
Shift() method removes the first element and whereas the pop() method removes the last element from an array. Both methods will change the original STRING array.
• charAt() It provides the char value present at
the specified index.
• concat() It provides a combination of two or
more strings.
• indexOf() It provides the position of a char
value present in the given string.
• lastIndexOf() It provides the position of a char
value present in the given string by searching a character from the last position.
• slice() It is used to fetch the part of the given
string. It allows us to assign positive as well negative index.
• toLowerCase() It converts the given string into
lowercase letter.
• toUpperCase() It converts the given string into
uppercase letter. • valueOf() It provides the primitive value of string object.
• split() It splits a string into substring array,
APznzabQWkwKaG MMt2BqKWG4o2gPw9rEhD41Adg8VtkG99p65at0kD0Otvy6dPjXIcG0Is2VwbIABD6qBQ5JsXwkKAXkUGqh8nx4FWO0YszkAYftl0Y1GTipAEuKK6Mz4 GRE 7vT8kDmuB3Ff6IhK8KAJkEGuvaDDIa16B4zJoC NriSyY4yYgNhkzDMaR4Lom2InUuAE4zQuGcmE2cgSUbdkkaHqs8mpVkj5z071