in JavaScript by
Q:

How to create an array in js and how to read array elements?

1 Answer

0 votes
by

Can you define arrays using the array literal as follows?

  • var x = [];
  • var y = [1, 2, 3, 4, 5];

An array has a length property that is useful for iteration. Can we read elements of an array as follows?

for (var i = 0; i < x.length; i++)
Click here to read more about JavaScript
Click here to read more about Insurance

Related questions

+1 vote
asked Jul 16, 2019 in JavaScript by Indian
0 votes
asked Oct 19, 2019 in JavaScript by SakshiSharma
+1 vote
asked Jul 16, 2019 in JavaScript by Indian
0 votes
asked Oct 19, 2019 in JavaScript by SakshiSharma
+1 vote
asked Jul 16, 2019 in JavaScript by Indian
+1 vote
+1 vote
...