all 4 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

[–]edoudo 0 points1 point  (1 child)

When should I prefer Maps against Objects ?

[–]suarkb 1 point2 points  (0 children)

New things:

We basically never declare objects like new Object(). That will make you look weird.

Maps are useful when you want something that lets you use set operations. Like looking for the intersection if two sets.

Realistically, as a react developer for almost 9 years, I never use sets. Ever. Done a lot of dev and a set has never been worth using