jscs-jsdoc
jscs-jsdoc copied to clipboard
checkTypes: "natives" should be "primitives" (see notes below)
typeof true
"boolean"
OK
typeof 1
"number"
OK
typeof 'foo'
"string"
OK
typeof {}
"object"
NOT OK
[].constructor.name
"Array"
OK
new Date().constructor.name
"Date"
OK
/test/.constructor.name
"RegExp"
OK
Well, but:
({}).constructor.name
"Object"
("").constructor.name
"String"
For some reason I assumed that plain object does not have .constructor.name.
@gajus Just noticed that natives should be primitives: https://developer.mozilla.org/en-US/docs/Glossary/Primitive Oopsie!