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 getPropertyValue(element, property) { | |
| return parseInt(window.getComputedStyle(element)[property].replace('px', '')) | |
| } | |
| function getOffsetRect(elem) { | |
| var box = elem.getBoundingClientRect() | |
| var body = document.body | |
| var docElem = document.documentElement |
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
| // === Arrays | |
| var [a, b] = [1, 2]; | |
| console.log(a, b); | |
| //=> 1 2 | |
| // Use from functions, only select from pattern | |
| var foo = () => { | |
| return [1, 2, 3]; |
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 fetchData(url, options, cb){ | |
| if(!cb) throw new Error('Please suply a callback function!'); | |
| if(!fetchData._cache) fetchData._cache = {}; | |
| var settings = { | |
| method: "GET", | |
| url: url | |
| } |