turn code into js