var a = new array();
a[1] = 'A';
b[10] = 'B';
console.log(a);
/*[undefined, "A", undefined, undefined, undefined, undefined, undefined, undefined,
undefined, undefined, "B"]*/
I want to remove undefined element but what is the process??
I want to remove undefined element but what is the process?? |
||||
feedback
|
First of all, jQuery has nothing to do with this. Second, arrays are "autofilled". If you define index What you're looking for is probably an object:
or
|
|||
feedback
|
well, to remove those
In your snippet, you fill the element with index To remove that fields you either have to set a proper value or Create an true
|
||||
feedback
|
In this case you can use an
|
|||
feedback
|
Arrays always start at 0 and then go up to the last filled index. You could use an object to solve your problem:
|
|||
feedback
|