Basic transformation to Javascript code