Csaba Kissi Profile picture
Dec 10 10 tweets 3 min read
How to use local storage in Javascript?

Let me show you 👇
Browser local storage is a feature of web browsers that enables websites to store data locally on the user’s computer.

This type of storage is used to store information that should persist even after the user has closed the browser.
It can also be used to store small amounts of data that needs to be available for a long period of time, even after the user has left the website.

Let me show you 4 most common methods:
1️⃣ Setting a value in local storage

localStorage.setItem("name", "John");

2️⃣ Getting a value from local storage

let name = localStorage.getItem("name");

// It will return: John
3️⃣ Removing a value from local storage

localStorage.removeItem("name");

4️⃣ Clearing all values from local storage

localStorage.clear();
Is there a limit to the amount of data that can be stored in the browser's local storage?

Yes, the limit varies depending on the browser and device, but generally, most browsers support up to 5MB of data stored in local storage.
Browser local storage should not be used to store sensitive information.

While local storage is relatively secure, it is still accessible by any malicious user accessing the client’s computer or device.
Additionally, if the user’s browser or device is compromised, then any data stored in local storage may become vulnerable.
If you like this post, you can bookmark and tag it by replying with @SaveToBookmarks #javascript

You can view your bookmarks on savetobookmarks.com
That's all for now.

If you found this list useful, consider:

✅ Follow @csaba_kissi for more content like this
🔔 Enable notifications 👀
🔄 Retweeting the first tweet.

Thanks for your support, guys! 🙏🤝

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Csaba Kissi

Csaba Kissi Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @csaba_kissi

Dec 11
How to create a simple Express server in Nodejs 👇 Image
First, you will need to create a project folder and then install the Express library.

To do this, open a terminal window and type:

npm install express --save
Once installed, create a file called index.js in your project folder.

This is where you'll write the code for your server.

In the index.js file, add the following code to import the Express library and start the server:
Read 8 tweets
Dec 9
5 interesting APIs you can use for your next project.

Thread 🧵👇
1️⃣ TheRundown

NFL, NBA, WNBA, MLB, NHL, NCAA Football real-time odds, scores, and schedules all in one place.

rapidapi.com/therundown/api…
2️⃣ Custom QR Code with Logo

Create unique looking QR codes with logo, color and design as PNG, SVG, PDF or EPS.

QR Codes can be generated in high quality for print and professional use cases.

rapidapi.com/qrcode-monkey/…
Read 7 tweets
Dec 9
There are 5 types of loops that are commonly used in JavaScript you should know about 👇
1️⃣ For loops:

This type of loop is used to execute a block of code a specified number of times.

It has the following syntax:

for (initialization; condition; increment/decrement) {
// code to be executed
}

e.g.

for (let i = 0; i < 10; i++) {
// code to be executed
}
2️⃣ While loops:

This type of loop is used to execute a block of code while a specified condition is true.

It has the following syntax

while (condition) {
// code to be executed
}

e.g.

while (i < 10) {
// code to be executed
i++;
}
Read 10 tweets
Dec 8
The console log is more powerful than most web developers think.

See below 👇 Image
Go to stackblitz.com and log in.

Stackblitz is an online code editor (I'm not affiliated with them)

You can even use the local Javascript file to test the following.
Open a new Javascript project. Image
Read 9 tweets
Dec 7
Difference between Bootstrap and Tailwind CSS.

What to choose and when? 👇 Image
Bootstrap and Tailwind CSS are both front-end frameworks, meaning they are collections of CSS classes that can be used to quickly apply styling to web projects.
Bootstrap is a very popular framework, and it's been around for a long time.

It provides a wide range of pre-designed components and styles that you can use to create beautiful, responsive layouts quickly.
Read 20 tweets
Dec 6
10 Tools/Libraries for Web developer you should know about.

I would not be surprised if you don't know about 9 of them. 👀
{1} ScribeHow (by @ScribeHow)

This screen recording extension instantly turns any procedure into an instructional.

Perfect for: founders, instructors, business people, and more.

Document and share procedures with 93% less effort.

🔗 getscribe.how/chrome
{2} HighFlux

Next-Generation Git Client

HighFlux transforms your development: it lets you focus on coding and collaborate with your team in real-time

🔗 highflux.io
Read 12 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(