Open JSeligstein opened 1 year ago
Please provide nodejs version.
I literally ran:
node init node install --save collections
Then ran the above file.
@JSeligstein that not what I asked you.
Please provide NodeJs and Npm version aka node --version
and npm --version
commands results...
Also this code does not pass the Javacript parser in my brain...
return ''+object.x+'.'+object.y;
See "+
Meaning even if I wanted your code is not valid anyway. You need provide valid code if you wish help, and name issue properly would be appreciated.
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 v19.0.1 % npm --version 8.19.2
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. I may assist with some issue here as co-maintainer.
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}));