const array = [
{
text: "hello",
number: 23,
},
];
const container = document.querySelector(".container");
const btn = document.querySelector(".btn");
btn.addEventListener("click", createText);
function createText() {
const newText = document.createElement("h1");
newText.innerText = `${array.text}`;
container.appendChild(newText);
}
i want to get value text from array? what is wrong? why i get undefined ??