DEV Community

Discussion on: Is there a reason to use == over ===?

Collapse
 
rafde profile image
Rafael De Leon • Edited

usually for nil

function isNil(value) {
  return value == null
}
Enter fullscreen mode Exit fullscreen mode

returns true if value is null or undefined

you can check this logic out in dev console

This is the only good example I can think of for using ==