Unlike Map, the Set object doesn't use key externally. To keep the values unique it uses the key internally. Thus, Set considers the value of element as a key.
The forEach() method is represented by the following syntax:
callback - It represents the function to execute.
value1, value2 - The value1 represents the key of the element whereas value2 represents the value. Both arguments contains the same value.
set - It represents the current Set object.
thisArg - It represents the value that treats as this when executing callback.
Let's see a simple example of forEach() methodTest it Now
Fetching values : key[jQuery] = jQuery key[AngularJS] = AngularJS key[Bootstrap] = Bootstrap