At work, we often use js arrays. But have you seen the following? 1. Text Subscript: 1 var a = []; 2 a [-1] = 1; have you ever wondered if the subscript of an array is negative? The subscript of the array starts from 0. However, the above statements can still be written. However, please refer to: 1 console. log (. length); // 02 console. log (a [-1]); // 13 console. log (a ["-1"]); // 14. hasOwnProperty (-1); // true indicates that the object property is stored here. 2. Two-dimensional array: copy the Code 1 var a = []; 2 a [] = 1; 3 a [] = 2; 4 a [] = 3; 5 a [1, 1] = 4; 6 7 console. log (. length); // 28 console. log (a [0]); // 39 console. log (a [1]); // 4 copying code js itself does not support two-dimensional arrays, so the length above is 2, its internal implementation is to treat the small two-dimensional array as a comma expression, so only one value is valid. If you want to implement a two-dimensional array, you can also: 1 var a = [1]; 2 var B = []; 3 B [0] = a; 4 console. log (B [0] [0]); // 13, object subscript: When the subscript of an array is an object, js will try to convert it to a value. If not, then it is converted into a string. 1 var a = []; 2 var B = {c: 1}; 3 a [B] = 2; 4 console. log (a [B]); // 2