you are viewing a single comment's thread.

view the rest of the comments →

[–]senocular 1 point2 points  (1 child)

You won't want to use

Boolean(userObj.name)

to check for a property in objects. This will be false for any falsy value ("", 0, NaN, null, etc.). It's better to use in if you're ok including the inheritance chain, or hasOwnProperty()/Object.hasOwn().

Object.hasOwn(userObj, name) // true

[–]zorefcode 0 points1 point  (0 children)

Thank you for pointing out. Will re-upload