Showing posts with label NodeJS. Show all posts
Showing posts with label NodeJS. Show all posts

April 01, 2020

Part 1: Node JS Tutorial-var vs let vs const in JavaScript

While declaring any variable we can use either var, let or const. In JavaScript, variables are initialized with the value of undefined when they are created. What that means is if we try to log the declaration variable, we’ll get undefined. e.g:

var name;
console.log(name); // this will print 'undefined'

Part 2: Node JS Tutorial- Understanding npm

Write your own module
Open visual studio code, create a new file with the name my-module.js. Let's create another file module-demo.js. We will declare a variable inside my-module.js and try to access it from module-demo.js.

In my-module.js, we have declared variable mytext.