-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set behavior vary from Browser vs Node? #249
Comments
Please provide nodejs version. |
I literally ran: node init Then ran the above file. |
@JSeligstein that not what I asked you. |
This comment was marked as resolved.
This comment was marked as resolved.
For some reason, in the past I feel like if you did int + string + int it would try to cast everything to Number instead of strings. The old-school trick was to use a string first. '' + x + '.' + y is perfectly valid, though perhaps unnecessary it may seem. Feel free to remove the single-quotes there. % node --version I'm sorry about the original answer. I thought you meant version of code. I'm tired today. |
Thank you, the nodejs version is usefull. No promise but I will look into giving some love to this project this weekend. |
The following code appears to work as expected (true) in browser, but fails in a brand-new clean node project. Am I missing something?
const Set = require('collections/set');
const myset = new Set(null, function(a, b) {
return a.x == b.x && a.y == b.y;
}, function(object) {
return ''+object.x+'.'+object.y;
});
myset.add({x:0, y:0});
console.log(myset.has({x: 0, y:0}));
The text was updated successfully, but these errors were encountered: