Navigate back to the homepage

How to store multiple strings in an array in Javascript?

Infinitbility
JavaScript
October 17th, 2022 · 1 min read

Hi Friends 👋,

Welcome To Infinitbility! ❤️

To store multiple strings in an array in javascript, use push() method it will add your passed parameter into an array.

Today, I’m going to show you How do I store multiple strings in an array in javascript, as mentioned above, I’m going to create a sample array variable then I will use push() to add new strings element.

Let’s start today’s tutorial on how do you store multiple strings in an array in javascript.

Javascript store multiple strings in an array

Here, we will do

  1. Create a sample array variable with data.
  2. Use push() method to add
1// Create a sample array variable with data.
2let arr = ["infinitbility.com"];
3console.log(arr)
4
5// Use `push()` method to add
6arr.push("aguidehub.com");
7console.log(arr)
8
9arr.push("sortoutcode.com");
10console.log(arr)

Output

I hope it helps you, All the best 👍.

Follow me on Twitter

Join our email list and get notified about new content

No worries, I respect your privacy and I will never abuse your email.

Every week, on Tuesday, you will receive a list of free tutorials I made during the week (I write one every day) and news on other training products I create.

Looking For React Native Tutorial?

we are trying to create the best Tutorial for react native developers.

When you want a daily updates about React Native Tutorial or infinitbility update subscribe to our newsletter.

Read React Native Tutorial

Request New Tutorial or Article on mail [email protected]

Guide book

Guidebook: The Javascript Monorepo Photoshop Guide

Tutorials

Categories

More articles from Infinitbility

Which method is used to lowercase all the characters in a string in Javascript?

An example of convert string all characters into lowercase with the step-by-step guide.

October 17th, 2022 · 1 min read

How do you split a string of numbers in Javascript?

An example of split a string of numbers in javascript with the step-by-step guide.

October 16th, 2022 · 1 min read
© 2020–2022 Infinitbility
About
Link to $https://medium.com/infinitbilityLink to $https://www.facebook.com/InfinitbilityLink to $https://github.com/infinitbilityLink to $https://twitter.com/infinitbilityLink to $https://www.buymeacoffee.com/infinitbilityLink to $mailto:[email protected]