Skip to content

Instantly share code, notes, and snippets.

@fleimisch
Last active September 7, 2019 09:41
Show Gist options
  • Save fleimisch/7a53653e721c219dc93ba12f9149240d to your computer and use it in GitHub Desktop.
Save fleimisch/7a53653e721c219dc93ba12f9149240d to your computer and use it in GitHub Desktop.
javascript shorthand list: https://www.sitepoint.com/shorthand-javascript-techniques/
SCE function to get and check element // will avoid "of unexpected.." error:
let a = x0(".MobileSearchWrapperHelper");
a ? a.style.display = "block" : void 0;
$(element).is(':visible')
element.offsetWidth > 0 && element.offsetHeight > 0;
window on load:
window.addEventListener('load', function() {
console.log('All assets are loaded')
});
for each:
arr.forEach(element => {
console.log(element);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment