الناتج هو "object":
console.log(typeof null); // "object"
هذا خطأ تاريخي من النسخة الأولى من JavaScript، وبقي حتى اليوم حتى لا تتعطل المواقع القديمة التي تعتمد عليه. null في الحقيقة ليس كائنًا.
كيف أتحقق من null؟
value === null // only null
value == null // null or undefined
typeof value === 'object' && value !== null // a real object
نتائج typeof الأخرى
typeof undefined // "undefined"
typeof 42 // "number"
typeof [1, 2] // "object" (use Array.isArray)