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.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This is a Ternary operator.
It is essentially a shorter if statement.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Hi, can you elaborate on that test 17 ?
It is the only test I fail, and I don't understand how you would solve it using logic.
If you change your tests cases, a lot of solutions will invalidate, that's true.
But it's fine, that's what Beta status is for, so you can improve your kata :)
Please add a test case with input between 3.14 and π and specify whether isPi should return
true
orfalse
.Take
3.1405
for example.I thought it should return
false
, but looking at the solutions it looks like everyone else thought it should returntrue
.So I think the kata description needs clarification on that point.
The filter callback function does not work like you think. It does not return a value, but returns a boolean which tells if the value should be kept or not in the filtered array.
The only advantage is less code as you said.
In most cases, using if/else is recommanded for readability.
Loading more items...