Skip to main content

JavaScript Snippets

To help with CSS debugging (from Smashing Magazine "Overflow Issues in CSS"):

[].forEach.call($$("*"),function(a){a.style.outline="1px solid #"+(~~(Math.random()*(1<<24))).toString(16)})

var vs let

var is function-scoped

let is block-scoped