Another JScript Array Question

Results 1 to 2 of 2

Thread: Another JScript Array Question

  1. #1
    Join Date
    Dec 1969

    Default Another JScript Array Question

    If an array or string for that matter in jscript is empty what will be the length of it. In vbscript, if say somearray has no elements and you do a Ubound(somearray) on it, it will be zero, but if it has only only one element Ubound(somearray) will be zero as well, so i used to use Len(somearray(0)) to make sure at least one element is initialized. Is this the same with jscript?

  2. #2
    Join Date
    Dec 1969

    Default lenght in JS is real...

    0 means "there ain&#039;t nuthin&#039; here."<BR><BR>var arr = new Array();<BR>alert( arr.length ); // shows zero<BR>arr[17] = "foo";<BR>alert( arr.length ); // shows 18!<BR>

Posting Permissions

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