❤1
// #2 declaration of variables
let a = 1 // block scoped variable
var b = 2 // accessible from other blocks{}
const c = 3 // constant variable
// it insures that program will not assign any value to it again
console.log("var1: " + a);
console.log("var2: " + b);
console.log("var3: " + c);
// @JsCode0
let a = 1 // block scoped variable
var b = 2 // accessible from other blocks{}
const c = 3 // constant variable
// it insures that program will not assign any value to it again
console.log("var1: " + a);
console.log("var2: " + b);
console.log("var3: " + c);
// @JsCode0
👍3
// #3 Taking input in node js
const readline = require('readline').createInterface({
input: process.stdin,
output: process.stdout
});
readline.question("Enter a number: ", (num) => {
console.log("You entered: " + num);
});
// @jsCode0
const readline = require('readline').createInterface({
input: process.stdin,
output: process.stdout
});
readline.question("Enter a number: ", (num) => {
console.log("You entered: " + num);
});
// @jsCode0
❤1