naming - Case of names of built-in JavaScript types -


in javascript, typeof 0 gives 'number' not 'number', instanceof 0 number.

would accurate canonical names of built-in types capitalized, , lowercase return value of typeof quirk/inconsistency can't changed historical reasons, changed if be? or missing something?

no,

actually number built-in value type number object.

if typeof there's no need temporarily convert 0 object.

if use instanceof, temporarily converts 0 object.

this similar string:

"sometest" => string

however, if "sometest".tolowercase() first (temporarily) convert string string-object , call method on object (since value-types can't have methods).

in short, lowercase means value-type, uppercase means object


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -