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.
Helpful. Thank you!
This comment is hidden because it contains spoiler information about the solution
Thanks.
I, too, wondered what the empty array was for. Thanks for you explanation @Balkoth!
@bigtallbill Thanks for the link of MDN ^_^
very helpful, thanks
This comment is hidden because it contains spoiler information about the solution
That makes sense. Thanks for the explaination @Balkoth.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I know it, but I forgot ! Sorry about that.
@Balkoth: Beware! Comments on kata solutions can be read even by those who haven't solved the kata yet. Don't forget to mark your comment as spoiler if it contains information related to 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
I think there’s absolutely no need to depend on such micro-benchmarks. The real bottlenecks are somewhere else. However, each of these conversion methods has its own caveats:
v.toString()
— works well, unlessv.toString
is not a function, that is whenv
is null or undefined or when.toString
was deliberately changed or deleted (very rare case)'' + v
— works withnull
s andundefined
s too, but might give some unexpected results for such objects as:in which case
'' + v
would return'5'
(very rare case)String(v)
— works every time, correctly calls.toString
method, if an object has one, and works fornull
s andundefined
s'' + [v]
or[v].join()
— same asString(v)
(unless you modifiedArray.prototype
), with exception ofnull
s andundefined
s becoming empty strings, which can be quite usefull sometimesIn the real world, it’s fine to use any of these methods, with caution while using
v.toString()
whenv
could benull
andundefined
. Choose, what’s most convenient/legible/usefull for you and your team. Performance differences are highly negligible.Loading more items...