Frage im Vorstellungsgespräch bei Netflix

Enhance the contains function to make it part of the JavaScript system (e.g. HTMLElement.prototype).

Antwort im Vorstellungsgespräch

Anonym

14. März 2012

HTMLElement.prototype.contains = function contains(b) { while ((this != b) && (b != null)) { b = b.getParent(); } return (this == b); }