I’m trying to make an array automatically and store it in another array by making an array and using new Array to do this but I don’t know how to name it.
here is my code:
<button id="newArray">New Array</button>
<script>
let newArray = document.getElementById("newArray")
let ArrayOfArrays = []
newArray.addEventListener("click", function() {
ArrayOfArrays.push(new Array(1,2,3))
ArrayOfArrays[0].name = numbers
numbers.push(4)
console.log(numbers)
})
</script>
it turns out that .name isn’t what you use for naming it and if it is you can’t call by it. I’ve tried arrayOfArrays[0] but that isn’t efficient enough.