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.
woooow)
yes i did that ^^
Thank you very much for your reply ;)
It's a bitwise OR operator which in this case (against 0) essentially cuts of all non integers. Here it's used as a somewhat crude and hacky way to avoid Math.floor() or parseInt().
My advise would be to be careful using it in your projects. The | 0 is easily overlooked and can leave your future you searching forever where your math doesn't add up. Math.floor() does a better job at being self-explanatory. Since the example above is very short, the | 0 doesn't hurt for the simple purpose it serves.
Also look at stanleyvarga's comment. He also makes a solid point not to use it everywhere.
What means this "|" in Javascript ?
This comment is hidden because it contains spoiler information about the solution
_
is often used as a variable that's unused (Other than in Lodash), it's just a variable name that doesn't really have a name.Hiii...
What is the use of
_
in(_,i)
? Please explain.This doesn't work with n = 0 but the tests aren't testing it.
With arguments [1,2,3,4,5] and 0, this returns [NaN: NaN], so I'm a bit confused how this passed.
const out = new Array(n).fill(0); //is more sleek
using modulus at the index: i%n is a good idea!
Cheating, it doesn't work for any m >= 200. :-/
Hey!
I can assure you that I have no intentions of offending anyone. The comment is just a play on a very well known quote from the movie
Titanic
as well as an internet meme.please change that 'code me like a French girl' comment – it's offensive
Loading more items...