This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"launch": { | |
"inputs": [], | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "launch", | |
"name": "Launch Current Opened File", | |
"program": "${file}" | |
} | |
], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Animal() { | |
this.offspring = []; | |
} | |
function Dog() { | |
Animal.call(this); // Use Animal.call(this, args) if any arguments | |
// exist. Else, use 'apply' | |
} | |
Dog.prototype = Object.create(Animal.prototype); | |
Dog.prototype.constructor = Dog; | |
var d1 = new Dog(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Animal() { | |
this.offspring = []; | |
} | |
function Dog() { | |
} | |
Dog.prototype = new Animal(); | |
Dog.prototype.constructor = Dog; | |
var d1 = new Dog(); | |
var d2 = new Dog(); | |
var pup = new Dog(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isInViewport(element) { | |
var rect = element.getBoundingClientRect(); | |
var html = document.documentElement; | |
if ( | |
rect.top >= 0 && | |
rect.left >= 0 && | |
rect.bottom <= (window.innerHeight || html.clientHeight) && | |
rect.right <= (window.innerWidth || html.clientWidth) | |
) { | |
return true; |