Javascript is the world's most popular programming language. It is easy to learn a web programming language.
It is one of the 3 languages all web developers must learn:
An array is a particular variable that can hold multiple homogenous values simultaneously. These are powerful and comprehensive tools of Javascript, and they are very intuitive to use, and you can do almost everything with them. However, there are essential differences between arrays in Javascript and other mainstream languages.
In Javascript, there are only 6 data types defined – the primitives (boolean, number, string, null, undefined) and object (the only reference type). Arrays do not belong to this list because they are objects as well. This is a common confusion among developers who assume that arrays are a particular data type in Javascript.
The items in the Array are nothing more than the properties of that objects. You can use any name as a property for an object, including numbers or even empty strings. However, the property name should be a valid identifier.
For Creating an array:
const array_name = [item1, item2, ...];
Or
Using “new” keyword
const arr = new Array("A", "B", "C");
There is no need to use "new" Array (). For simplicity, readability and execution speed, use the first method to create an array.
Knowledge2life 1,Knowledge2life 2
website,online,Learning