JavaScript Pseudoclassical Example