Last active
August 29, 2015 14:10
-
-
Save michaelficarra/c553d6ebc5a44611ce4f to your computer and use it in GitHub Desktop.
ES6 Set.prototype.map issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var set = new Set([0, 1]), | |
f = function(x) { return 1 / x; }, | |
g = function(x) { return x ? -0 : x; }; | |
set.map(g); // Set{0} | |
set.map(g).map(f); // Set{1/0} | |
set.map(function(x){ return f(g(x)); }); // Set{1/0, -1/0} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment