How to create arrays in javaScripts?
Printable View
How to create arrays in javaScripts?
If your are looking for Android app development company in Chennai to outsource your application project, then kindly contact us at smarther@outlook.com or call us +91 9003162488. We will get back to you in less than 24 Hrs.
Android App Development company
Android App Development company
You can create an array in javascript by following code.
var fruits = ['Apple', 'Banana'];
console.log(fruits.length);
// 2
__________________
php malicious code scanner
You can declare the array in three ways there are by literal,using the array constructor,creating instance of array directly..
1] var array_name = [item1, item2, ...];
2] var cars = new Array("Saab", "Volvo", "BMW");
3] var person = {firstName:"John", lastName:"Doe", age:46};