You've probably met
typeof operator in the past. In the Accounting module of Watch and Code Premium,
typeof is used to check if a value is
- Primitive data types
- Symbol (introduced in ES6)
- Complex data type
So what's up with
function as a value? Well, it turns out that
typeof has multiple bugs that were never fixed due to backward compatibility.
function being reported as one of the values is just one of those backward compatibility issues we're stuck with.