JavaScript: Array How-To

By Xah Lee. Date: . Last updated: .

Is there a range function to generate array?

JavaScript: Range Function for Array

How to check if a object is true array?

Array.isArray(obj) returns true for true array.

〔➤see JavaScript: What's Array-Like Object?

How to clone or deep copy a array?

JavaScript: Clone, Deep Copy Object/Array

How to compare 2 arrays?

JavaScript: Array Compare Equality

How to get max value of a array?

JavaScript: How to Get Max/Min Value of a Array?

How to randomize array?

JavaScript: Random Array Element, Randomize Array

How to convert array to string?

Use the join method.

console.log(
    [3,4,5].join("-")
); // prints 3-4-5

〔➤see JavaScript: Array.prototype

How to flatten a nested array?

JavaScript: Flatten Nested Array

Array Topic

  1. JavaScript: Array Basics
  2. JavaScript: Understand JS Array
  3. JavaScript: Create Array
  4. JavaScript: Sparse Array
  5. JavaScript: What's Array-Like Object?
  6. JavaScript: How to Convert Array-Like Object to Array?
  7. JavaScript: Array How-To

  1. JavaScript: Array Object
  2. JavaScript: Array.prototype
Like what you read? Buy JavaScript in Depth
or, buy a new keyboard, see Keyboard Reviews.