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.
Está bien pero podrias directamente cambiar el operador a negativo :D
love this
I agree. Also, in Node.js there is URL constructor available where you can parse the host easily then in JS we also have location.host. So why reinvent the wheel.
This comment is hidden because it contains spoiler information about the solution
I appreciate the spirit behind this kata. However, it needs a significant rework or needs to be retired.
I would recommend specifying a subset of the real world functionality like
However, if you took these suggestions then the problem is not very interesting anyway.
This comment is hidden because it contains spoiler information about the solution
great detaild explanation!
Did this while on the phone with someone. Could be cleaned up significantly but the method makes sense.
@pepkin88: It would be nice if we had benchmarks on different engines, because I'm hesistant to declare one solution or another "best practices" without seeing some performance measures...
[].concat
looks for propertyconcat
in the newly created object[]
. It doesn't find it, so it looks for that property in the prototype of that new array object.Array.prototype.concat
also makes 2 lookups, first forprototype
property of Array function, second forconcat
property ofArray.prototype
object. So the difference is creation an empty array object[]
.All of that is only in theory, because the real behavior depends on the engine‘s implementation. It could be optimized for such situations and could skip some steps (eg. would skip creating a new, later unused, array object, or would translate
Array.prototype
directly to that object, without a lookup).Thank you for the detailed explanation xcthulhu! Your response has helped to clear up some of my confussion with apply().
In the comments for this post on SO, SLaks explanation of
[]
versusArray.prototype
was:"
[]
is shorter, but it creates an extra array instance.Array.prototype
is longer but faster."I'm not sure if that's correct, so maybe somoene here can verify that is the case and provide a citation to documentation that indicates the veracity of the statement.
cool solution!!!!
you win, sir.
This comment is hidden because it contains spoiler information about the solution
lol
Loading more items...