Zero-based learning in JavaScript