Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Oh, you're right. I thought that was part of your code, because I saw you used a map :p This is actually an issue then.
Edit: node 8 disabled.
if you attempt function checkThreeAndTwo(array) {
return true
} on node v8 it throws you stderr.
There is no ?? operator in code above
Did you select node v18 at the top? If that doesn't fix it, maybe you modified sample tests?
Either way, you should include the actual error message, not just the line that caused the error. If I run your code with node 8, I get "SyntaxError: Unexpected token ?", which makes sense, because
??
didn't exist in earlier versions.Changed node version to 18 and problem is solved
I have stderr even if function is primitive and return constant value
STDERR:
/home/codewarrior/index.js:42
(map, x) => map.set(x, (map.get(x) ?? 0) +
awesome kata
You are welcome! Part 2 just got approved. https://www.codewars.com/kata/665bf5790be3c249ffb9422b
I like this kata. Thank you