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.
No, your code is just keeping track of which
indices
are even, not their respective actual array values.It seems you passed the kata, was it an error in your code?
I got an error for a test case that was supposed to be correct.
This is a summary of my work:
Original array: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Number: 2
New array with evens: [ 0, 2, 4, 6, 8, 10 ]
Returned array: [ 8, 10 ]
But I got this error => expected [ 8, 10 ] to deeply equal [ -8, 26 ], but there is no '-8' or '26' in the original array
But for anybody left wondering: if
o
is anObject
and not a primitive (Number, BigInt, Boolean, String, Symbol, null, undefined
),Array.fill(o)
will fill the array with all the same objectso
, ie. by reference and not by value.So poking a
1
into the first line would poke a1
into every line, because all lines would reference the same object, etcetera.Haskell translation
approved
C Translation (author inactive).
what a coincidence 😅
Thx for approval btw :D
well, let' pick your version, it has better error feedback
oh no, I already did it :(
JS fork updating the test cases and framework to Node.JS v18 (assisted with Katafix)
For JS Node 18 should be enabled.
The Dart translation looks good.
Loading more items...