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.
String interpolation for the win!
Because outside of a very narrow set of high performace situations, it doesn't matter at all. Even the cheapest embedded computer can do this in nanoseconds. And treating it like strings is more intuitive since the problem cares about them more like strings than numbers.
It was written before ..= was stabilized.
This comment is hidden because it contains spoiler information about the solution
This was a quick example. In ES6, you can (and should) actually throw an object that accuratly describes your exception. This reading has some leads I advise everyone to follow on the subject: http://stackoverflow.com/questions/38145977/how-to-throw-invalidargumentexception-javascript
Fixed.
Thank you.
You actually throw the "Error" constructor here. Not an error object, just the function that could create an error.
Not that it matters much in a kata, but throwing strings instead of errors means that you won't get a stacktrace, making errors harder to locate. Don't try that at home, kids! :)
it prints "Hello Austin, welcome to PHP!", it doesn't return it
can anyone explain?
Yes... I changed it for surtich...
The first point in "[1.3..7]" is supposed to be a comma, right?
Wouldn't it be possible to extend the system so the kata creator defines a fixed interface? That way, test cases and code could run in two seperate runtimes.
Most katas I have seen say something like:
"define a function bla that returns a value blub"
At least this sounds more reliable then a "Cheat detection". (I could see this go horribly wrong)
Or how about allowing downvotes?
A solution that does not contain any spoilers! Nice.
This comment is hidden because it contains spoiler information about the solution
Loading more items...