JavaScript Questions

LITON AHMED
3 min readMay 15, 2021

Falsy vs Truthy

Falsy and Truthy is a matter where some things are false and some things are true such as false, 0, “”, undifiend, null, NaN. ““, [], {} Etc. are always true. When I put the lie inside the “” string again, it becomes true again

Undefind vs NaN

undefined can be found in many ways such as- I have taken a variable but I have given its name but I have not given any value then it will show undefined. Again I am writing a function but I have not returned anything. Will then show undefind. I am returning again but I did not say what it will return, then it will show undefind. I took another function again but I took the parameter inside it at 2 o’clock but passed 1 o’clock then it will show undefind. Again, I took some values ​​inside an arrey / object, but I called with a value whose value is not inside that arrey / function. Then show undefind. NaN is a thing like there was something in a place but now it is not there then I can show NaN.

== Vs ===

== and === The two are comparator == which means just check the value of the two but not the type. Again === Value will check both types.

Closure

When I call or return from one function to another. Then he creates a close environment. When we call or return an internal function, it excels an external variable. Then the function we are accessing has a value of its own and the one we are returning has a value of its own. It’s as if they’re creating a close environment.

Bind

If there is a method on one object, I will tie that method and throw it on another object, then I will use my bind. Then the object from which the method has been taken will not have any loss which is due to this object.

Call

When we use the same method for another object, the first argument will be the value of this. That is the object on which I will call. Then we can take as many arguments or parameters as we want.

Apply

The call and the application work in much the same way, only the comma is written when the call is written and the parameters are sent as ‍ARREY when the application is written.

Window and global variable

The call and the application work in much the same way, only the comma is written when the call is written and the parameters are sent as ‍ARREY when the application is written.

This

This is a thing that when we execute it, if there is nothing to its left, it will be a window, and if it is left, it will be its context.

asynchronous

Whatever we do in JavaScript it will constantly output us just like it does before or after if we don’t set any such function and it says asynchronous

set timeout

Set timeout in JavaScript is when we write a function in which we write ‍set timeout then that work will happen just then. Again, if we settle something so normal, then that work will be our output or work after that. Et There are two things to do in set timeout, one is function and the other is how long it will take to set the time.

set interval

set interval is the time we set the exact time it will call. Until we stop.

--

--