Hi dev,
In this article we will learn about Arrays in javascript.
In JavaScript, we can create an array in different ways. Let us see different ways to create an array. It is very common to use const instead of let to declare an array variable. If you are using const it means you do not use that variable name again.
// syntax
const arr = Array()
// or
// let arr = new Array()
console.log(arr) // []
// syntax
// This the most recommended way to create an empty list
const arr = []
console.log(arr)
Hope it can help you…
Categories : JavaScript
Tags : JavaScript