Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Show HN: Nsynjs – JS engine with stoppable threads and without callback hell. Parent comment
example code:
var anchors = document.getElementsByTagName(“a”); for(var i=0,len=anchors.length; i<len; i++){ alertClickAnchor(i); // Named function } function alertClickAnchor(i) { // Closure anchors[i].onclick = function() { alert(i); } }
example code: