Skip to content

Instantly share code, notes, and snippets.

@smallpaes
Last active June 2, 2019 07:21
Show Gist options
  • Save smallpaes/23f9ce190f63c09867426784f08034ea to your computer and use it in GitHub Desktop.
Save smallpaes/23f9ce190f63c09867426784f08034ea to your computer and use it in GitHub Desktop.
Get wish list from localStorage and display it
const wishList = JSON.parse(localStorage.getItem('wishList')) || []
//display each wish on the wish list
function displayWish(input) {
displayArea.innerHTML += `
<li>${input}<span>X</span></li>
`
}
function displayWishList() {
wishList.forEach(wish => displayWish(wish))
}
//display all the wish on the list from localStorage
displayWishList()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment