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.
dont need use return if function wrote in 1 line
This comment is hidden because it contains spoiler information about the solution
arrow functions :)should have thought of that cool
Nicely done. Arrow fuctions are ideal for one-liners.🔥
Lol. This is really clever! Wonder what execution time would look like.
I've never thought that this as well as
'' + b
converts the variable to String. And it does. Even withnull
,undefined
andNaN
as a value of variable.Nice one!
I don't believe I would have ever thought of this. Nice.
Very Nice
No problem, you're welcome.
Right, now I can see my mistake, I was thinking exactly oposite(that there is right output is 2x^2).
English is not my native language, so I misunderstanded task)
Thank you for explaining, now I get it)
That means, the derivative of x^2 should be noted as 2x^1 instead of 2x. I think you didn't get that part.
Your code returns 2x^2 instead. That's why it is invalid.
It's from description:
..."^1" should not be truncated when exponent = 2.
Yes, it will pass, but it shouldn't. If it pass it doesn't mean "it's correct".
It passes, why do you say it won't? Have you tried it? Your code is wrong and it passed because random tests didn't generate a test with exponent = 2.
won't pass when exponent = 2
Loading more items...