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.
It breaks when
end
can legally be0
though.Better ( now; it hasn't always been available ) is
function friday13(start,end=start)
. See MDN.Nice one: "end = end || start" I always use conditional statement instead...
Why not
===
?Using proto really isn't a good idea.
See MDN: Object.prototype.proto
I did something like this and it kept giving me errors... happy to know i was on the right track...
hi,
i don't think it is the safest think to do. actually this method (evilTwin) is returning the global object (window) to be the evil twin of "obj" object.
i see some problems in doing that:
first of all it is changing the global object (is changing its prototype);
second, if this method is called twice for two different "obj" objects, the global object will be realocated to be the evil twin of the second object and the first object will remain without its evil twin;
if this function is executed in a strict mode "use strict", the "this" value will no longer be the global object, but it will be undefined, resulting in an error beeing thrown (TypeError).
so, this solution was good here, but don't do this in a real application. it is not safe. ;)