Through this article for you to introduce some of the small problems of the array, perhaps for everyone a little help, this article is not good, but also please forgive me heroes.
1.
var arr = [,,];
arr["BBB"]= "nor";
Arr[-]= "nor";
Console.log (arr); >> [,,, BBB: "Nor",-: "nor"]
//Console.log (ARR.BBB) >> "nor"
If we want to add a value to the array, added as [], if a negative number or string is written, it is added at the end of the array, and it is added as a key-value pair, so the next time you access the value, you can access it by using a dot, but if the numbers must be accessed through [].
2.
var arr = [,,];
arr["BBB"]= "nor";
Console.log (arr); [,,, BBB: "nor"]
Console.log (arr[]) undefined
If you add a value to the array by a string or negative number, you must also access the key value on the next visit
3.
var arr = [,,];
arr["BBB"]= "nor";
arr[-]=;
Arr.push ();
Console.log (arr); >> [,,,, BBB: "nor"]
It is worth noting that the value added through a string or negative number, that array will not add its length, and that this way to add will always be at the end of the array, because we use the push method to add 4 when we found that it did not add to the last, We all know that the push method adds a value to the end of the array. Maybe we can come to the conclusion that is numeric and numeric permutations, with key pairs aligned with key-value pairs.
This article through the above three points to a simple analysis of JavaScript in the array add value and Access values FAQ, I hope to help. At the same time, cloud Habitat Community Small series in this wish You happy Spring Festival!