You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
code var __spreadArray = (this && this.__spreadArray) ||function(to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar ||!(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
var visited = new Set();
var visualization = [];
visited.add(1);
visited.add(2);
console.log(visited, __spreadArray([], visited.keys(), true));
visited
Program output:
From sandbox: Set {} []
Normal set operations work like .size or has, but there is no way to access the items in the Set other then an operation like:
When transpiling typescript that has Set usage, many operations do not work as expected. Works correctly when using conventional JS syntax.
Example:
Output:
When attempting to run transpiled typescript (ts is identical to js code in prev example) with the same operation:
Transpilled JS output:
Program output:
Normal set operations work like .size or has, but there is no way to access the items in the Set other then an operation like:
Transpiled TS
Output of program:
The text was updated successfully, but these errors were encountered: