JS Built-ins
Setbeginner

Set Constructor β€” typeof

πŸ“– Usage Example
const s1 = new Set()          // empty
const s2 = new Set([1, 2, 3]) // from array
console.log(s2.size) // β†’ 3

Use the Set constructor to create a new set, optionally passing an iterable.

Set Constructor

typeof a Set instance returns 'object'.

Challenge: Verify that typeof new Set() is 'object'.

πŸ’‘ Hints (1)
  • β€’ Set instances are objects