1.What are Cookies?
A cookie is a piece of data that is stored on your computer to be accessed by your browser. You also might have enjoyed the benefits of cookies knowingly or unknowingly. Have you ever saved your Facebook password so that you do not have to type it each and every time you try to log in? If yes, then you are using cookies. Cookies are saved as key/value pairs.
You can create cookies using document. cookie property like this.
document.cookie = "cookiename=cookievalue"
Hoisting is the default behavior of moving all the declarations at the top of the scope before code execution. Basically, it gives us an advantage that no matter where functions and variables are declared, they are moved to the top of their scope regardless of whether their scope is global or local.
It allows us to call functions before even writing them in our code.
// using arrow functions
const x = (x, y) => x * y;
Number String Boolean Object Undefined
- What is === operator?
=== is called a strict equality operator, which returns true when the two operands have the same value without conversion.