Tag: array methods

Recent Post

map() vs forEach()

The map() and forEach() methods both iterate through arrays, but are not interchangeable.

How to print a JavaScript array to the DOM

Learn how to print a JavaScript array to the DOM in readable format.

How to sort an array of objects by the value of a property in JavaScript

Learn how to sort an array of objects by the value of a property.

Emptying a JavaScript array

Emptying an array is easy, but methods vary in their impact on references made to the array in other

Find the index of an element in a JavaScript array by value

Get the index value of any element in an array by value and instance of its appearance.

Remove element from a JavaScript array by value

How to remove an element array element by value with and without mutating the original array.

Removing array duplicates in JavaScript

Three ways you can remove duplicate items from an array.

Merging several strings into one in JavaScript

Learn how to merge multiple strings into one in various formats, including a comma-separated list.

The right way to clone an object in JavaScript

We investigate how to make a proper 'deep clone' of an object in JavaScript.

Higher-order array methods with simple examples: map, filter, sort and reduce

Use flexible higher-order array methods to help achieve your programming objectives.