RcBuilder@walla.com
call centre: 054-5614020

javascript Array Name index

08
Jan
2015
Posted by: RcBuilder  /   Category: Array / JAVASCRIPT   /   No Comments

javascript Array Name index

example 1

var mat = new Array();
mat['arr1'] = ['Roby', 'Ron', 'Avi', 'Yuri', 'Yossi'];
mat['arr2'] = ['Shirly', 'Ronit', 'Maayan', 'Galit', 'Shulamit'];

alert(mat['arr1'][2]); // Avi
alert(mat['arr2'][1]); // Ronit

example 2

var arr = new Array();
arr['255'] = ‘Roby’;
arr['123'] = ‘Ron’;
arr['567'] = ‘Avi’;
arr['111'] = ‘Yossi’;
arr['522'] = ‘Ronit’;
arr['900'] = ‘Galit’;

alert(arr['900']);

notice!

this technique is not created an actual array by an object with properties
so all the methods of array will not work here

Author Avatar

About the Author

בניית אתרים ופתרונות טכנולוגים | RcBuilder

No Comments


  • פיתוח מערכות
  • פתרונות טכנולוגים
  • קידום אתרים
  • בניית אתרים