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


Groups > comp.lang.javascript > #29888

Re: Can i compare with an empty array element?

Newsgroups comp.lang.javascript
Date 2016-03-11 00:16 -0800
References <9d670045-35dd-4279-a4e5-2e3cdae867e7@googlegroups.com>
Message-ID <2613221c-bd10-4e41-8838-65cd64adde48@googlegroups.com> (permalink)
Subject Re: Can i compare with an empty array element?
From jonas.thornvall@gmail.com

Show all headers | View raw


Den fredag 11 mars 2016 kl. 08:58:27 UTC+1 skrev jonas.t...@gmail.com:
> function untangle_links(arr)
> {
>    printnode = new Array;
>    var j = 0;
>    var tempnode = 0;
>    var tnode = new Array();
>    for(var i = 0; i < nodes; i ++ )
>    {
>       for(var k = 0; k < tnode.length; k ++ )
>       {
>            if (arr[tempnode].nodelinks[j] == tnode[k])//Is this ok?
>          {                                            //tnode[k] undefined or NaN?
>             j ++ ;
>          }
>       }
>       tempnode = arr[tempnode].nodelinks[j];
>       tnode[tnode.length] = tempnode;
>       printnode[i] = tempnode;
>       j = 0;
>    }
>    return printnode;
> }

I do not think i should need a special case to compare with null, undefined or NaN. But you never know. I mean if it isn't the same it isn't.

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


Thread

Can i compare with an empty array element? jonas.thornvall@gmail.com - 2016-03-10 23:58 -0800
  Re: Can i compare with an empty array element? jonas.thornvall@gmail.com - 2016-03-11 00:16 -0800
    Re: Can i compare with an empty array element? Simon Blackwell <syblackwell@anywhichway.com> - 2016-03-14 06:00 -0700

csiph-web