scrimba
Learn JavaScript
Chrome Extension
Use a for loop to log out leads
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

To see this lesson you need to be logged in. Joining Scrimba is free and gives you access to 20+ courses.Sign up
Use a for loop to log out leads
AboutCommentsNotes
Use a for loop to log out leads
Expand for more info
index.js
run
preview
console
let myLeads = []
const inputEl = document.getElementById("input-el")
const inputBtn = document.getElementById("input-btn")

inputBtn.addEventListener("click", function() {
myLeads.push(inputEl.value)
console.log(myLeads)
})


// Log out the items in the myLeads array using a for loop



Console
<ul
id=
"ul-el"
>
,
/index.html
-1:39