JavaScript Array Snippets

The JavaScript snippet collection contains a wide variety of ES6 helper functions. It includes helpers for dealing with primitives, arrays and objects, as well as algorithms, DOM manipulation functions and Node.js utilities.

  • Initializes and fills an array with the specified values.

  • Head of array

    JavaScript, Array

    Returns the head of an array.

  • Array union

    JavaScript, Array

    Returns every element that exists in any of the two arrays at least once.