Well-known symbols in JavaScript

There are special built-in symbols that are used by JavaScript for service purposes. Such symbols are called well-known symbols.

An example of such a symbol is Symbol.iterator, which contains a function that iterates over arrays. Let's check its presence in some array:

let arr = [1, 2, 3]; let func = arr[Symbol.iterator]; console.log(func);

Make a Map collection. Check if it has the Symbol.iterator key.

Make a Set collection. Check if it has the Symbol.iterator key.

enru