Categories

Jul 16, 2019 in JavaScript

Q:

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

1 Answer

Jul 16, 2019

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

Madanswer
Jul 16, 2019 in JavaScript
Jun 16, 2019 in JAVA
Oct 19, 2019 in JavaScript
...