javscript range function code example Example 1: range in javascript See below link Example 2: javascript range [...Array(5).keys()]; => [0, 1, 2, 3, 4]