Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #32613

Re: Array elements and "subarrays?" internal dependencies

Newsgroups comp.lang.javascript
Date 2017-02-12 00:24 -0800
References <63222c13-59bb-4187-921e-c9c8410d2492@googlegroups.com>
Message-ID <dff1eb77-d748-4d6a-bc1e-7876878b34ea@googlegroups.com> (permalink)
Subject Re: Array elements and "subarrays?" internal dependencies
From jonas.thornvall@gmail.com

Show all headers | View raw


Den söndag 12 februari 2017 kl. 07:50:06 UTC+1 skrev jonas.t...@gmail.com:
> arr[m] ={nodelinks : [], hold : false, rposX : 0, rposY : 0, rwidth : 10, rheigth : 10, rcolor : "red" , bcolor : "green"};
>       printnode[m]=m;
> 
> 
> I thought i would be smart to have an array with nodes and subarray? with nodelinks, directly attached upon the  array element index without using a nodeindex attribute. 
> 
> But now as i need to splice elements i rearrange the elementindex=nodeindex unwillingly without rearrange the nodelinksindexes. 
> 
> There is probably no way to deal with this other than go back to use the attribute nodeindex off array? 
> 
> Because i guess there is no smart way to let the sub indexing of nodelinks[] be dependent upon the indexing of arr[]?
> 
> Well that was not very smart of me, but thought i did save some labeling.
> 
> I must say i am a bit confused by the terminology should i refer to array above as an array or an object? And then what is nodelinks an attribute or a property of arr, or a  subarray?
> 
> Someone ones told me there is no multidimensional arrays in javascript, well it looks like one.

Well now i am a bit confused, a full reordering of noderelationships, or make the node[indexing] unrelated to the element[indexing], a reordering only need to run once as you splice, and if you get it right have no effects on the program.

But the other one leave a gap between arr element indexing and the actual index of nodes, but i think a nodeindex only used during data printout and painting canvas, but i could be wrong. 

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Array elements and "subarrays?" internal dependencies jonas.thornvall@gmail.com - 2017-02-11 22:50 -0800
  Re: Array elements and "subarrays?" internal dependencies jonas.thornvall@gmail.com - 2017-02-11 23:12 -0800
  Re: Array elements and "subarrays?" internal dependencies jonas.thornvall@gmail.com - 2017-02-12 00:24 -0800
  Re: Array elements and "subarrays?" internal dependencies John Harris <niam@jghnorth.org.uk.invalid> - 2017-02-12 11:21 +0000

csiph-web