Skip to content

Instantly share code, notes, and snippets.

@ranamahmud
Created November 2, 2020 14:30
Show Gist options
  • Save ranamahmud/437c32e783e3bbc03086f5df667024bd to your computer and use it in GitHub Desktop.
Save ranamahmud/437c32e783e3bbc03086f5df667024bd to your computer and use it in GitHub Desktop.
// first way
var numbers = [1, 3, 4, 5];
console.log(numbers)
// [1, 3, 4, 5] // output
// using Array Class()
var fruits = new Array();
fruits[0] = "apple";
fruits[1] = "banana";
fruits[2] = "orange";
console.log(fruits)
// ["apple", "banana", "orange"] // output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment