JavaScript e-son implementation