Skip to content

Instantly share code, notes, and snippets.

@InTheCloudDan
Created January 24, 2017 00:33
Show Gist options
  • Save InTheCloudDan/25facba78a26a34d45fa97b48947ccac to your computer and use it in GitHub Desktop.
Save InTheCloudDan/25facba78a26a34d45fa97b48947ccac to your computer and use it in GitHub Desktop.
let state = {
todos: [
{ title: 'First todo', complete: false },
{ title: 'Second todo', complete: false },
{ title: 'Third todo', complete: false },
],
}
var ul = document.createElement("ul")
document.body.appendChild(ul)
state.todos.map(todo => {
let newItem = document.createElement("li")
newItem.textContent = todo.title
return ul.appendChild(newItem)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment