Tiny Frontend Logo
Posts 0113

On This Page

JavaScript: Local Storage

Understanding how to store data on the client side is essential for creating robust web applications. In this article, we'll explore local storage, one of the key mechanisms for caching data within the user's browser. Let's dive in!

What is Local Storage?

Local storage is a client-side storage solution that allows web applications to store data persistently within the user's browser. Unlike session storage (which is limited to a single browsing session), local storage retains data even after the user closes the browser or navigates away from the website. It provides a convenient way to cache information such as user preferences, application state, and dynamic responses.

How Does Local Storage Work?

Here are the key features of local storage:

  • Key-Value Pairs: Data in local storage is stored as key-value pairs. You can set, retrieve, and remove values using JavaScript methods.
  • Storage Limit: Most modern browsers provide around 5-10 megabytes of storage per origin (domain). Keep in mind that this limit is shared across all pages served from the same domain.
  • Persistence: Local storage data persists across browser sessions. It remains available even if the user closes the tab or reopens the browser later.
Subscribe to read the full content

* Free subscribe to enjoy full content access.
* You can cancel anytime with 1-click.

Read Next

0112

JavaScript: Session Storage

As a frontend developer, understanding how to store data on the client side is crucial. In this article, we’ll delve into the world of web storage, specifically focusing on session storage. Let’s explore what it is, how it works, and when to use it.

JavaScript: Session Storage
0110

Cross-Origin Resource Sharing (CORS)

Please imagine you're building a spiffy weather application using JavaScript and you want to display live weather data from a popular weather service.

Cross-Origin Resource Sharing (CORS)
0109

Cross-Site Scripting (XSS) in JavaScript

Cross-Site Scripting (XSS) is a web security vulnerability that allows an attacker to inject malicious code into a web page that is viewed by other users.

Cross-Site Scripting (XSS) in JavaScript
0108

Multiple Promises Handling in JavaScript

Promises are a powerful way to handle asynchronous operations in JavaScript. They allow us to write clean and readable code, without using callbacks or nested functions.

Multiple Promises Handling in JavaScript
0107

Promises for Asynchronous JavaScript

In this guide, we'll delve into the ins and outs of promises, covering their syntax, usage, common patterns, and best practices.

0106

Styling the First Letter

The ::first-letter pseudo-element applies styles to the first letter of a block container.

Styling the First Letter