Mohammad Rahman
3 min readMay 12, 2021

--

Truthy and Falsy values

In javaScript, all Values are checked Booleans = true / False ..

if the value is true then the program going executive if value going false then Display Massage.

Truthy value Example :

if (true)
if ({})
if ([])
if (42)
if ("0")
if ("false")
if (new Date())
if (-42)
if (12n)
if (3.14)
if (-3.14)
if (Infinity)
if (-Infinity)

Null Vs Undefined, different ways you will get undefined:

Null: Null Value is a Special meaning “ No Value “.

Example :

var y= null;

console.log(y);

Undefined: Undefined Value is meaning not Deacleard any value.

Example :

var z;

console.log(z);

Double equal (==) vs triple equal (===)

Double equal (==)..

double equal does check only value not going check Type.

and Triple equal(===) are do check value and type bouth .

Example for Double equal (==):

const first =2;

const second =”2";

if (first== second ){

console.log(“ Condition is true”);

}elase {

console.log(“Condition is False”);

}

// Output cone : Condition is true.

Triple equal Example (===).

const first =2;

const second =”2";

if (first=== second ){

console.log(“ Condition is true”);

}elase {

console.log(“Condition is False”);

}

// Output cone : Condition is Flase.

Closure:

Closure: In Javascript Closure is Create one Function Environment .. and work code under this Environment ;

Example of Closure Code :

function stopWatch (){

let count =0;

return function =0;

count ++;

return count;

}

const clock1 = stopWatch()

// If want see console.log there .

console.log(clock1)

// output come [function]

console.log(clock1());

console.log(clock1());

console.log(clock1());

console.log(clock1());

// output come :

1 ,2,3,4, // is going increase +1 value .

What is the Scope?

The scope is referred the current context code, which determines the accessibility of JavaScript.

block scope:

ES6 allows the to developer Declare the variable in const and let .. which means those variables are the corresponding block.

What is DOM?

DOM (Document Object Model ). The browser creates a representation of the document known as the Document object model (DOM).DOM allows accessing the javaScript manipulation element and style of the website.

DOM working tree style-wise :

What is an API, the purpose of API, GET?

what is an API;

API- Application Programming Interface. API makes it easier for programming. API actually used when graphical something show in UI(user interface t).

The purpose of API .

API is like a Data bank .. Programmer when need any data to show in UI … then this data call from API …so if we can say API use for programming field as a Data Bank.

GET :- Get our HTTP request method. Get send to request to the server for specific data and this data show in UI … this time some cash data are going save client pc .

--

--