Last active
June 2, 2019 07:21
-
-
Save smallpaes/23f9ce190f63c09867426784f08034ea to your computer and use it in GitHub Desktop.
Get wish list from localStorage and display it
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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