The storage capacity of local storage is 5MB/10MB.
As it is not session-based, it must be deleted via javascript or manually.
The client can only read local storage.
There is no transfer of data to the server.
There are fewer old browsers that support it.
The storage capacity of session storage is 5MB.
It's session-based and works per window or tab. This means that data is stored only for the duration of a session, i.e., until the browser (or tab) is closed.
The client can only read local storage.
There is no transfer of data to the server.
There are fewer old browsers that support it.
Global scope contains all of the things defined outside of all code blocks. A code block simply consists of grouped statements inside curly braces ({ }). if statement, loops, function are examples of structure that create a code block. A global variable has global scope. A global variable is accessible from anywhere in the code.
Local scope contains things defined inside code blocks. A local variable has local scope. A local variable is only accessible where it’s declared.
An event loop is a mechanism that allows JavaScript to execute a callback function after a given event has occurred. For example, when a user clicks a button on a web page, an event is generated and the event loop will execute the callback function associated with that event.
Undefined is a property of the global object. That is, it is a variable in global scope. The initial value of undefined is the primitive value undefined.
In all non-legacy browsers, undefined is a non-configurable, non-writable property. (Even when this is not the case, avoid overriding it.)
A variable that has not been assigned a value is of type undefined. A method or statement also returns undefined if the variable that is being evaluated does not have an assigned value. A function returns undefined if a value was not returned.