Array is used to store multiple elements in a single variable. It is often used when we want to store a list of elements and access them by a single variable.
The arr.concat() method is used to merge two or more arrays together. This method does not alter the original arrays passed as arguments. For example:
var num1 = [11, 12, 13],
num2 = [14, 15, 16],
num3 = [17, 18, 19];
The arr.filter() method is used to create a new array from a given array consisting of only those elements from the given array which satisfy a condition set by the argument method.
- Output: [24,33,40]
Subscribe and follow us for latest news in Data Science and Machine learning and stay updated!