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.
Haskell translation
Question: why
1 <= len(commands)
?0
would be perfectly valid, and it's actually2
( for a single fixed test ).There's a difference between "simple and easy" and "trivial". Trivial is making a single stdlib call into a kata, and yes, those kata should not exist in my opinion ( other opinions may be available ). I wouldn't necessarily class this kata as trivial, but it wasn't me saying it it.
I am happy ( enough ) with the one character increase of the limit. Thank you!
A multiplication and a division are a mighty thin task to build a kata out of. Consider unpublishing this task and getting more better inspiration.
The result should not be an integer. Read documentation on why rounding is bad, and how to do it instead.
Feels like a duplicate.
Example tests:
That failure message doesn't hint very much.
[].push.call
isn'tpush
, it'scall
, without a context.Function.prototype.call.bind(Array.prototype.push)
might work; I haven't actually checked.Sample tests do contain mixed-case strings. Submit tests do not contain fixed cases.
I also fail so see the difference from single-case handling in the example solution. If the batch processing is a design choice, the example solution should showcase that difference.
That would make sense if the additional performance were actually required, and mapping individual modpows over the list would timeout. Is it, and does it?
Array length is a number, not a string.
My actual problem is
console.log([])
printing[undefined]
within my functions. This is apparently not caused by the enumerability of prototype methods, because it didn't go away when I fixed that. I don't know why[]
would become[undefined]
, but it can't be good.No.
The correct way to extend prototypes is non-enumerably, probably with
Object.defineProperty
. Adding prototype properties enumerably gives all sorts of problems.There is a difference between
reduce(xs,fn,undefined)
andreduce(xs,fn)
. Both are valid, so this scenario should be tested. ( See my solution how to test for missing or undefined parameter. )Loading more items...