Defining an array in JavaScript

There are 3 ways of defining an array in JavaScript, each with its own charm.

Create robust functions

To define a function that can accept arbitrary number of parameters in
JavaScript, invoke the arguments array within the function. This special array
contains all of the parameters passed into it.

Generating a random number

To generate a random number in JavaScript, use the built-in function Math.random().

Syndicate content