Tuesday, March 29, 2022

Installing NodeJS

 1. Visit https://nodejs.org/en/download/ and download the version as per your system specifications and OS

2. Install the NodeJS.

3. Open VS Code editor and in menu bar select the Terminal Menu and click New Terminal. 







4. Now it opens the Terminal depending on your OS and system settings. Now type node -v   which prints the version of NodeJS installed. 



Installing Visual Studio Code

Visual Studio Code (also Known as VS Code) is the preferable IDE for developing Web apps using NodeJS. This is a product of Microsoft and can be installed from the following link https://code.visualstudio.com/download.

The main advantage is the Intergrated Terminal. 

After successful installation, it appears as follows:




typeof

 Usage of typeof

1. The type of null is object.

2. Uninitialized variables have undefined as the type.

console.log(typeof 23);
console.log(typeof 3.14);
console.log(typeof "RK");
console.log(typeof true);
console.log(typeof null);

let a;
console.log(typeof a); //Undefined

let b = 18;
console.log(b, typeof b);



OUTPUT


Sunday, March 27, 2022

Javascript Operators

 The following is the list of operators available operators in Javascript:

  1. Arithmetic (+, - , *, /, %, **)
  2. Comparison/Relational ( <, <=, >, >= , ==, != , ===, !==)
  3. Logical (&&, ||, !)
  4. Increment and Decrement (++ and --)
  5. Assignment & short-hand assignment 
  6. Conditional
  7. Bitwise
  8. Special operators

Javascript - Primitive Data types

 The following is the list of primitive/basic data types in Javascript

  1. Number (which means both integer and floating point type)
  2. String 
  3. Boolean (supports true / false )
  4. undefined
  5. null


Javascript supports Dynamic Typing which means the datatype is associated is value rather than variable. Programming languages like C, Java support static typing which means variable is associated with datatype.

Variables in Javascript 

They can be defined using let or var keywords as follows:

var age=25;

console.log(age);            //25 

console.log(typeof age);     // prints Number


The typeof operator is used to print the datatype of the value.