Double Dimensional Array in Javascript Returning Undefined Array -



Double Dimensional Array in Javascript Returning Undefined Array -

this question has reply here:

javascript 2 dimensional arrays [duplicate] 6 answers

i have searched alot , cannot clear reply problem.

var rowcount = 3; var mycounter = 0; var mynewarray = new array(); (var = 1; < rowcount; i++) { seek { mynewarray[mycounter][0] = i; mynewarray[mycounter][1] = i; mycounter = mycounter + 1; } grab (err) { alert(err.message); } }

it giving , exception saying mynewarray[mycounter] undefined. thought why? have seen other post , have shown declare array or new array([]). nil working. need help, in advance give thanks you.

currently mynewarray array elements trying access in not yet exist (undefined) need set these elements arrays

var rowcount = 3; var mycounter = 0; var mynewarray = new array(); (var = 1; < rowcount; i++) { seek { //set element array if want access array mynewarray[mycounter] = []; mynewarray[mycounter][0] = i; mynewarray[mycounter][1] = i; mycounter = mycounter + 1; } grab (err) { alert(err.message); } }

javascript arrays multidimensional-array

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -