This site is mobile accessible. Press the "Tap Here" button to use a smaller font-size.
Smartphone icons created by Freepik - Flaticon
The typeof operator returns object for both objects, arrays, and null.
The typeof operator does not return object for functions.
document.getElementById("demo").innerHTML = typeof {name:'john', age:34} + "<br>" + typeof [1,2,3,4] + "<br>" + typeof null + "<br>" + typeof function myFunc(){};
object function
The
operator returns " " for arrays because in JavaScript arrays are objects.