Code for JavaScript