I'm reading 'Professional Javascript for Web Developers' Chapter 4 and it tells me that the five types of primitives are: undefined, null, boolean, number and string.
If null
is a primitive, why does typeof(null)
return "object"
?
Wouldn't that mean that null
is passed by reference (I'm assuming here all objects are passed by reference), hence making it NOT a primitive?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…