Re: associative arrays

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> On Nov 2, 2021, at 2:25 PM, Christoph M. Becker <cmbecker69@xxxxxx> wrote:
> 
> On 02.11.2021 at 07:24, JEFFRY KILLEN wrote:
>> Hello:
>> 
>> I have been programming php and javascript for some time.
>> I have not come on a way to navigate upward in javascript
>> objects (it does not have associative arrays but objects are
>> often used in the same way associative arrays are used)
>> 
>> To create a metaphor: it is like a squirrel jumps from another tree and lands on a branch. It
>> can find its way to the trunk and to the ground.
> 
> The squirrel doesn't ask the branch how to get to the trunk or to the
> ground, though.  Instead, it remembers its way so far. :)
> 
> --
> Christoph M. Becker

Not quite, a better analogy would be the squirrel doesn’t know on what branch his father found his mother.

More specifically, an array inside another array doesn’t know it’s inside another array. In fact, it’s simply a memory address that can only be located via an index inside another array, which is yet another memory address. Ask any memory address where it is and it can answer you, but it can’t offer much more information other than what it is — after all, it’s just a memory address.

If you want data to tell you what data proceeded it, then look into a double linked-list. That might solve your problem.

Cheers,

Tedd

Tedd Sperling
tedd.sperling@xxxxxxxxx




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux