Javascript Challenges

Ghost Array

Take a look at this code:

Snippet 1

var arr = [];
arr[999] = 'john';
console.log(arr.length);

Exercise

Correct!
False!

What is the result of execute "Snippet 1" code?

Snippet 2

var arr = [];
arr[4294967295] = 'james';
console.log(arr.length);

Exercise

Correct!
False!

What is the result of execute "Snippet 2" code?

Exercise

Correct!
False!

Why?

Snippet 3

var arr = [];
arr[4294967295] = 'james';
console.log(arr[4294967295]);

Exercise

Correct!
False!

What is the result of execute "Snippet 3" code?

Exercise

Correct!
False!

Why?

Snippet 4

var arr = [];
arr[Number.MIN_VALUE] =  'mary';
console.log(arr.length);

Exercise

Correct!
False!

What is the result of execute "Snippet 4" code?

Exercise

Correct!
False!

Why?

Snippet 5

var arr = [];
arr[Number.MIN_VALUE] =  'mary';
console.log(arr[Number.MIN_VALUE]);

Exercise

Correct!
False!

What is the result of execute "Snippet 5" code?

Exercise

Correct!
False!

Why?