Welcome to My Blog

...
Difference between Local Storage and Session Storage

localStorage and sessionStorage are almost identical and have the same API. The difference is that with sessionStorage, the data is persisted only until the window or tab is closed. With localStorage, the data is persisted until the user manually clears the browser cache or until your web app clears the data. This tutorial features localStorage, but the syntax for sessionStorage is the same.With this knowledge, you can now create, read, and update key/value pairs in localStorage.

Read More
...
Difference between Global scope and Block scope

A variable declared outside a function, becomes GLOBAL.Before ES6 (2015), JavaScript had only Global Scope and Function Scope.ES6 introduced two important new JavaScript keywords: let and const.These two keywords provide Block Scope in JavaScript.Variables declared inside a { } block cannot be accessed from outside the block.

Read More
...
Why we get Undefined in JavaScript

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.

Read More
...
What is event loop in javascript

JavaScript has a runtime model based on an event loop, which is responsible for executing the code, collecting and processing events, and executing queued sub-tasks. This model is quite different from models in other languages like C and Java.

Read More