Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

1st Timer Node

/* Simple Hello World in Node.js */
var teacherName = "Haha"; //This defines a new variable named teacherName with the value "Daniel"
console.log(teacherName); //Logs my name to the console
var languageLearning; //This creates a variable with no value. We can add a value later.
console.log(languageLearning);
languageLearning = "NodeJS"; //assigns a value to the variable
console.log(languageLearning);
const meaningOfLife = 37; //creates a constant for the meaning of life
console.log(meaningOfLife);
/*
  This is a multiline comment.
  Anyways, we write variables in camelCase. That means the first letter is lowercase and each word starts with a capital letter.
  Variable names may not have spaces or start with numbers. They can have numbers elsewhere though.
  After hitting run, uncomment the next line and see what happens!
*/
//meaningOfLife = 5; //changes meaningOfLife

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.