Tag: methods
How to use array methods in Javascript?
In JavaScript, arrays have numerous methods. Here’s a list of the commonly used array methods available: push Array.prototype.push() Add one or more elements to the end of an array and return the new length. const jottupFruits = [‘apple’, ‘banana’]; const newLength = jottupFruits.push(‘cherry’); console.log(jottupFruits); // Expected output: [‘apple’, ‘banana’, ‘cherry’] console.log(newLength); // Expected output: 3 […]
Posted in
Javascript
also tagged
es6
fundamental
methods