If I run this code in the jsFiddle it correctly seems to log the typeof
, first six are strings
then the seventh index is an object
. However in my personal local code, all seven indexes are a string
, and if you copy and paste this code into the console it logs all also as a string
. Why is this?
jsFiddle: https://jsfiddle.net/xcuje23q/
JS:
var someArray = ['Mike','Brett','Kim','Steve','Amy','Tanner',{name:'Oliver'}];
for(var i = 0; i < someArray.length; i++){
var name = someArray[i];
console.log(typeof name)
}