JavaScript · Middle · Question 29 of 75

What is Symbol used for?

Explanation

Symbol('id') is always unique, and symbol keys don't show up in for...in or Object.keys. Built-in "well-known" symbols customize object behavior: Symbol.iterator, Symbol.toPrimitive, Symbol.asyncIterator.

Further reading

Problem with a question

JavaScript · Middle · question 29

Test yourself

Take the JavaScript · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz