I faced this problem when I learn javascript. I tried the following code:
var arr = [1, 2, 3];
console.log(arr instanceof Array); // true
console.log(arr[0] instanceof Number); // false
var arr = [{key: 'val'}, {key1: 'val2'}];
console.log(arr[0] instanceof Object); // true
I was wondering it will log true in console, but it does not come as expected.
Please help me to understand this. Thanks in advance.