Array Initialiser 要小心

/*
Trailing commas in array literals add to the length, but they shouldn‟t. JScript treats the empty element after the trailing comma as undefined. Example:
*/
 <script> 
        document.write([1, 2, 3,].length); 
 </script> 
/* 
       Output: 
                IE: 4 
                FF: 3 
                Opera: same as FF 
                Safari: same as FF

你可能感兴趣的:(java,IE,Opera,Safari)