How are you uploading? the command-line IDE should tweak any code formatting to make it work.
Also if you use K&R-style formatting (with the opening bracket on the same line) everything will just work even if you upload the raw characters.
edit: if you're using a command-line app, you need to use the proper espruino one - several others have been made, but generally they don't check over the code and reformat the lines as described above (they also tend to miss out quite a lot of other steps too)
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
How are you uploading? the command-line IDE should tweak any code formatting to make it work.
Also if you use K&R-style formatting (with the opening bracket on the same line) everything will just work even if you upload the raw characters.
edit: if you're using a command-line app, you need to use the proper
espruino
one - several others have been made, but generally they don't check over the code and reformat the lines as described above (they also tend to miss out quite a lot of other steps too)