I'm not sure why my 'name' variable is undefined when you click the 'Add List' button.
Here's the suspected problem code:
function addList() {
let name = prompt("What would you like your list to be called?");
console.log(name);
if (name != null) {
console.log(name);
let name = new list(`${name}`, "[]");
const markup = `
<div id="${name}">
${this.name} List:
<br>
${this.items}
<br>
${this.button}
<br>
</div>
`;
document.getElementById("Shopping").append(markup);
}
return;
}
Here's the codepen: https://codepen.io/vaughnick/pen/YYBoeq
Thanks for any insight/ tutorials you can link for me in my journey :)