https://www.youtube.com/watch?v=TMuno5RZNeE
Encapsulation ?
- OO weaken encapsulation by introducing
private
,public
,protected
Inheritance ?
- why Java doesn't have inheritance ? Diamond problem
Polymorphism
https://www.youtube.com/watch?v=TMuno5RZNeE
Encapsulation ?
private
, public
, protected
Inheritance ?
Polymorphism
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
elem.clientLeft
, elem.clientTop
, elem.clientWidth
, elem.clientHeight
elem.getClientRects()
, elem.getBoundingClientRect()
// Promise.all is good for executing many promises at once | |
Promise.all([ | |
promise1, | |
promise2 | |
]); | |
// Promise.resolve is good for wrapping synchronous code | |
Promise.resolve().then(function () { | |
if (somethingIsNotRight()) { | |
throw new Error("I will be rejected asynchronously!"); |