Is there a way to find the data type composition of an array without using a loop like below
var anArray = [
        52,
        "A string",
        new Date(),
        "spatula"
    ],
    typeVar,
    compOfArray = {};
for (var i in anArray) {
    typeVar = typeof anArray[i];
    if (!compOfArray[typeVar])   compOfArray[typeVar] = true;
    else                         compOfArray[typeVar] += 1;
}
 
     
     
    