start new:
tmux
start new with session name:
tmux new -s myname
| var elements = document.querySelectorAll("div"), | |
| callback = (el) => { console.log(el); }; | |
| // Spread operator | |
| [...elements].forEach(callback); | |
| // Array.from() | |
| Array.from(elements).forEach(callback); | |
| // for...of statement |
| function getStyle(el, styleProp) { | |
| var value, defaultView = el.ownerDocument.defaultView; | |
| // W3C standard way: | |
| if (defaultView && defaultView.getComputedStyle) { | |
| // sanitize property name to css notation (hypen separated words eg. font-Size) | |
| styleProp = styleProp.replace(/([A-Z])/g, "-$1").toLowerCase(); | |
| return defaultView.getComputedStyle(el, null).getPropertyValue(styleProp); | |
| } else if (el.currentStyle) { // IE | |
| // sanitize property name to camelCase | |
| styleProp = styleProp.replace(/\-(\w)/g, function(str, letter) { |