Results 1 to 2 of 2

Thread: Referring itself

  1. #1
    Join Date
    Apr 2011

    Referring itself

    Hi all,
    How can an array element refer itself? Suppose I have an array like this,

    var a=[[1,2,{f:function(){var b=a[0][1];}}],

    So in function f, how can i change the assignment line to something like
    var b=this_array_element[1] dynamically or there is a way doing so?


  2. #2
    Join Date
    Jan 2009
    Well I don't know myself but your using var and not returning anything from the function.

    I would have thought that
    var a=[[1,2,{f:function(){ b=this[0][1];}}],
    would have had some part to play in the process.

    I suggest you start with that idea and play around until you his the mark. I still think that you should be returning a value but thats only my thoughts.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center

Recent Articles