How to create arrays in JavaScript?

How to create arrays in JavaScript?

Arrays are created by using new Array() in Java Script.
For example
var employees = new Array();

The elements to this array is assigned as follows –
employees[0] = "Kumar"
employees[1] = "Fedrick"

How to create arrays in JavaScript?

Although you can create the arrays using ‘new’ (var myArray = new myArray[10];), it is recommended that you create it in the following way: var myArray = [];

You don't need to tell Javascript how many items to size the Array for. Javascript automatically increases the size of the Array as needed.
What is a software design pattern?
What is a software design pattern? - A reusable software design solution in general for the problems that are recurrently occuring....
What is an analysis pattern?
What is an analysis pattern? - It is a software pattern which is not related to a language. It is related to a business domain like health care, telecom...
Differences between analysis patterns and design patterns
Differences between analysis patterns and design patterns - Analysis pattern are targeted for domain architecture, where as design pattern are targeted for implementation...
Post your comment