-4

Let's say we have an object with only one key value pair, where the key is null, declared using:

const myDict = { null: 'value 1'}

Why when we use the === operator to check if the key is null, JavaScript returns false?

const myDict = { null: 'value 1'}
console.log(Object.keys(myDict)[0] === null)
Sam
  • 888
  • 10
  • 25

0 Answers0