Bug Tracker

Changes between Initial Version and Version 1 of Ticket #13021, comment 6


Ignore:
Timestamp:
Jun 24, 2015, 1:52:17 AM (4 years ago)
Author:
ZengWq572
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #13021, comment 6

    initial v1  
    1 This bug is not exactly fixed. There are still some cases that makes each function do   not work well. For example:[[BR]]
    2 
     1This bug is not exactly fixed. There are still some cases that make each function do not work well. For example:
    32{{{
    43// If the object.length == 0
     
    1110    console.log(value);
    1211})
    13 }}}[[BR]]
     12}}}
    1413
    1514There is nothing to be console.log(ged) out.[[BR]]
     
    2827    console.log(value);
    2928})
    30 }}}[[BR]]
     29}}}
    3130
    3231There are something logged out. But the result is not what I want. Under jQuery 1.11.2 version, the logged result is:[[BR]]
     
    3534undefined
    36351
    37 }}}[[BR]]
     36}}}
    3837
    3938I have check the jQuery source, there is a isArraylike function used to check whether it should use for...in or for to iterate the object:[[BR]]
     
    5655        typeof length === "number" && length > 0 && ( length - 1 ) in obj;
    5756}
    58 }}}[[BR]]
     57}}}
    5958
    6059In fact, there is no good method to check whether an object is arraylike or not. My question is:[[BR]]