Take a look at this code:
var arr = [];
arr[999] = 'john';
console.log(arr.length);
1000
__match_answer_and_solution__
var arr = [];
arr[4294967295] = 'james';
console.log(arr.length);
0
__match_answer_and_solution__
Because 4294967295 overflows the max number of elements that could be handled by Javascript in Arrays.
__match_answer_and_solution__
var arr = [];
arr[4294967295] = 'james';
console.log(arr[4294967295]);
"james"
__match_answer_and_solution__
Javascript arrays can work as objects, dictionaries, when you are using as key any value that can not be handled by Array objects.
__match_answer_and_solution__
var arr = [];
arr[Number.MIN_VALUE] = 'mary';
console.log(arr.length);
0
__match_answer_and_solution__
Javascript arrays can work as objects, dictionaries, when you are using as key any value that can not be handled by Array objects.
__match_answer_and_solution__
var arr = [];
arr[Number.MIN_VALUE] = 'mary';
console.log(arr[Number.MIN_VALUE]);
"mary"
__match_answer_and_solution__
Javascript arrays can work as objects, dictionaries, when you are using as key any value that can not be handled by Array objects.
__match_answer_and_solution__