Interview Hub
Sign in

Q23: What is a `Symbol` used for?

MidJavaScript 29

Answer

Primitive unique identifier; useful for non-colliding object keys (Symbol.iterator), metadata, or library-private properties. Not enumerable in normal Object.keys loops unless you use Reflect.ownKeys.

Having a tech or coding interview? Check 29 JavaScript & Node.js interview questions.

EditorJavaScript · local only