Let’s say you have following
Set of numbers, which you want to convert to array.
One way of converting a
Array is using
The Array.from() static method creates a new, shallow-copied Array instance from an array-like or iterable object.
Another, way of converting a
Set to array is using spread operator.
set variable we will wrap it inside square brackets and spread the variable as follows
Both the approach work fine and the results are same.