styleguide icon indicating copy to clipboard operation
styleguide copied to clipboard

Correction: jsguide.html - Changed null to undefined

Open KumarSidharth opened this issue 1 year ago • 1 comments

This change is "Not important".

Please don't review this leaving your work behind.

Change description

Keys not defined in an Object are undefined.

const o = {width: 42};
o.maxWidth === null // false
o.maxWidth === undefined // true
image

KumarSidharth avatar Feb 01 '24 10:02 KumarSidharth

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Feb 01 '24 10:02 google-cla[bot]

the example is using !=, not !==, so there is coercion involved, so I think this is written correctly following the guidance:

https://google.github.io/styleguide/jsguide.html#features-equality-checks-exceptions

vapier avatar Jul 03 '24 11:07 vapier