#10: typeof function(){}
Topic: misc · Difficulty: ★
console.log(typeof function(){});Output
function
Why
Functions in JavaScript are objects — they have properties, can be assigned to variables, and are technically instances built on Function.prototype. But typeof carves out a special case for them: instead of reporting 'object' like it does for arrays, dates, and plain objects, it reports 'function'. This is the only exception to 'reference types report as object' in the entire typeof table, which is what makes it worth memorizing.
More misc puzzles