Skip to content
Advertisement

Tag: jslint

How to initialize an array’s length in JavaScript?

Most of the tutorials that I’ve read on arrays in JavaScript (including w3schools and devguru) suggest that you can initialize an array with a certain length by passing an integer to the Array constructor using the var test = new Array(4); syntax. After using this syntax liberally in my js files, I ran one of the files through jsLint, and

Advertisement