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
// Create a sample array variable with data.
let arr = ["infinitbility.com"];
console.log(arr)

// Use `push()` method to add
arr.push("aguidehub.com");
console.log(arr)

arr.push("sortoutcode.com");
console.log(arr)

Output

I hope it helps you, All the best đź‘Ť.