I have read a lot of negativity about scripting on OS X.
So far I have to agree, even running a script requires a keyboard with numpad for me.
I saw this in a tutorial:
var sum = 5 + 9; console.println(sum);
For me it prints undefined.
"undefined" actually means the code finished executing without returning any values. I think you probably ran only the first line of code. When running code from the console you need to select (either with the mouse or the keyboard) all of the lines of code before running it. It's a bit of a pain but after once or twice you don't think about it anymore.