javascript one liners start with -e or -p

spidermonkey:

js -e 'try{throw "Hello World!"}catch(t){switch(t){default:print(t)}}'

node:

node -e 'try{throw "Hello World!"}catch(t){switch(t){default:console.log(t)}}'

node -p 'try{throw "Hello World!"}catch(t){switch(t){default:t}}'

Advertisements