Kamis, 22 September 2016

How to work with arrays in javascript

An array is a collection of elements. Unlike in Java, arrays in JavaScript can contain elements of different types. A data element can be a primitive value or a reference to other objects or arrays. An Array object can be created in two ways. First way is by using the newoperator as shown below: var array1 = new Array(10, 20, “hai”);  var array2 = new Array(10); In the first declaration, the size of array1 is 3 and the values are initialized to 10, 20 and “hai”. In the second declaration, the size of array2 is 10 and the elements are

The post How to work with arrays in javascript appeared first on Coding Security.


How to work with arrays in javascript
read more

Tidak ada komentar:

Posting Komentar