qestion : 1what is the different between local storage and seccion storage
Ans : sessionStorage is similar to localStorage ; the difference is that while data in localStorage doesn't expire, data in sessionStorage is cleared when the page session ends. Whenever a document is loaded in a particular tab in the browser, a unique page session gets created and assigned to that particular tab.
qestion : 2what is the different between global scope and local scope
Ans : There are two types of variables: global variables and local variables. The scope of global variables is the entire program whereas the scope of local variable is limited to the function where it is defined
qestion : 3how do work js even loop
Ans : The Event Loop has one simple job — to monitor the Call Stack and the Callback Queue. If the Call Stack is empty, the Event Loop will take the first event from the queue and will push it to the Call Stack, which effectively runs it. Such an iteration is called a tick in the Event Loop.
qestion : 4how many get undefined
Ans : 1. when a variable assing but not set a value.
2. when a functon call but no return.
3. when set a object key but not set a key value.
4. when calla empty array or empaty object call