Thứ Tư, 10 tháng 2, 2016

Read array value using for... in statement in javascript

     for...in is used to read the value from objects, it can read all the objects or array values one by one. In the following example we are discuss how to read the array value using for...in.

Syntax

for(variable in array_or_object)

{

  statements;

}

Example

    var ar=[2,4,5,2,7,48,234];

   

    for(i in ar)

    {

      alert(ar[i]);

    }


Example Program:- (Editor)


Editor is Loading...

Advertisement




Tags:
for loop in allinworld99, for...in using javascript in allinworld99, allinworld99 to read array value.

0 nhận xét:

Đăng nhận xét