Day with javascript

Moyuri Akther
3 min readMay 8, 2021

Truthy and Falsy: When you write if/else statement in any programming language, you expect to pass a value in the if() condition that is strictly boolean which means either true or false. In a if else condition, when you check your conditions. if you declare a variable but not give its value it is undefined. when your variable is undefined your result is false. if you declare a number variable it gives you always output true except its value 0.

Double equal (==) vs triple equal(===): by double equall(==) we assign a value Ex: let age == 23; //here we assign age 23. And triple equal use in compare. Ex:

here age === 23 is meaning if age equal 23 then output is true, otherwise false.

Null vs Undefined: Null is an assignment value. you can assign any variable null value which basically means blank. and the other hand undefined means that the variable has not been declared or the variable has not given any value.

Scope: In programming, the scope is like one kind of block.
The scope is at the base closures, which defines the idea of global and local variables. if we declare a variable at the top of the code and outside any function, it is called global scope. we can access global scope from anywhere. if we declare a variable inside a function it is called local scope.

If we declare a variable to a scope by var, it automatically moves to its parent level and is converted to the global scope. but if we declare with const/ let it cant be a global variable.

Closure: If we call or return a function from another function, then create a closed environment.

Call, Bind and Apply: Calls a function Further arguments are provided as a comma separated list. Call argument always separated by commas. Calls a function with a provided further arguments are provided as a single array. Apply accepts arguments as an array. bind is the only method out of the three that does not call the function returns a new function altogether.

Let, Const and Var: Const: if you declare a variable with const You can’t re-assign the value of the variable again. it is fixed. Let: let variable is similar to var variable only difference is it is a block scope. block scope means if you anything declare let inside a function, loop or anything it cant be access from outside. var: var is the only way to declare a new variable. but it has a problem with function scope. it means if we declare a variable with var anywhere it became a global variable.

API GET POST: API: Every website creates its own API for there customer and internal user. POST: If we want to get some information from the user then we use the get method. GET: If we want to give information to the user then we use the get method

JS CallBack Function: In javascript, we can pass function as parameters. and call them inside the outer function.

--

--