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.
I love this!
To solve more and more katas. And then, If you came back here, you'll think this kata is super easy ;-)
Of course, google is your friend ;-)
I'm still a bit new to the programming world and have no idea how the bit version works. Does this method have a certain term in the computer science world that I can google to learn more?
Awesome thankyou!
You are right, only array and object (in es6 Map, Set) can return multiple values.
Third line only return stack and is same as:
stack.push(oper[el] ? oper[el](+stack.pop(), +stack.pop()) : +el);
return stack;
The comma operator allows you to put multiple expressions in a place where one expression is expected.
You should look for "comma operator javascript" in Internet.
On the third line I'm having trouble getting any answers from google on how the last part works. Specifically after returning
"stack.push(oper[el] ? oper[el](+stack.pop(), +stack.pop()) : +el)"
you have in the same return the following
", stack".
It kind of looks like returning two values which as far as I know is impossible in javascript without returning them both inside a single object or an array. My question is, what does the ", stack" part do and how does it work?