0.1.3 • Published 6 years ago
helloworldnodejs v0.1.3
Writing Hello World in console using node.js:
Write Hello World in node.js
in my code, i write console.log() method,
Function of console.log() method.
console.log() method used for printing some text in the console.
example:
when i write code like this:
console.log('Hello Sugar Labs team.....');
-Save it somewhere with .js extension.
-Run CMD.
-And change the directory using "cd" command to your local project folder.
-And type command like 'node YOURFILENAME.js'
.
-Press enter.
-You will see "Hello Sugar Labs team....."
in your console.
Writing with string variable
You can change the words with string too.
ex:
var name = Rainer;
console.log('Hello ' + name);
and run cmd again, you will see "Hello Rainer" in your console.
Thats's all for the console.log()
method.
Thanks for reviewing.
Regards.
Rainer A. Regan.
New Developer in the future :D.