Getting started with Javascript. Needed an editor and found warm references on SublimeText, so I installed it. Good tool.
Since I wanted to test/run some code before putting it up on my server, I needed something to test code locally. Again returning to the internet, I found Nodejs and installed it. So far so good.
First test:
alert("Hello World");
works fine on my website, doesn't work on Nodejs. I later found I need to use
console.log("Hello World");
on Nodejs.. If it was just 1 difference, I could probably cope, but my next attempt
var answer = prompt("just type in something");
failed too, for the same reasons..
I get that Nodejs and webservers are different beasts, and serve different purposes, but on the other hand: how do you test your code before putting it on your server?
AAAAAAHHHHH!!! This is driving me bonkers. Not to mention SublimeText accepts both (so that is not helping me either)
Is there a way to get Nodejs to accept the same code as would run on my server?