-
-
Save raloliver/57fb50cefabe9cf009c31605b3eba715 to your computer and use it in GitHub Desktop.
JS Bin// source http://jsbin.com/qixotiz
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>listViewUsers</title> | |
| </head> | |
| <body> | |
| <ul data-list></ul> | |
| <script id="jsbin-javascript"> | |
| const users = [ | |
| { | |
| name: 'Fernanda', | |
| id: '1' | |
| }, | |
| { | |
| name: 'Israel', | |
| id: '2' | |
| }, | |
| { | |
| name: 'Laura', | |
| id: '3' | |
| }, | |
| { | |
| name: 'Ben', | |
| id: '4' | |
| } | |
| ] | |
| const listUsers = (user) => { | |
| return user.map((item) => { | |
| return ( | |
| ` | |
| <li> | |
| <span>${ item.id }</span> | |
| <span>${ item.name }</span> | |
| </li> | |
| ` | |
| ) | |
| }).join('') | |
| } | |
| const listView = document.querySelector('[data-list]'); | |
| listView.innerHTML = listUsers(users) | |
| </script> | |
| <script id="jsbin-source-javascript" type="text/javascript">const users = [ | |
| { | |
| name: 'Fernanda', | |
| id: '1' | |
| }, | |
| { | |
| name: 'Israel', | |
| id: '2' | |
| }, | |
| { | |
| name: 'Laura', | |
| id: '3' | |
| }, | |
| { | |
| name: 'Ben', | |
| id: '4' | |
| } | |
| ] | |
| const listUsers = (user) => { | |
| return user.map((item) => { | |
| return ( | |
| ` | |
| <li> | |
| <span>${ item.id }</span> | |
| <span>${ item.name }</span> | |
| </li> | |
| ` | |
| ) | |
| }).join('') | |
| } | |
| const listView = document.querySelector('[data-list]'); | |
| listView.innerHTML = listUsers(users)</script></body> | |
| </html> |
This file contains hidden or 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 users = [ | |
| { | |
| name: 'Fernanda', | |
| id: '1' | |
| }, | |
| { | |
| name: 'Israel', | |
| id: '2' | |
| }, | |
| { | |
| name: 'Laura', | |
| id: '3' | |
| }, | |
| { | |
| name: 'Ben', | |
| id: '4' | |
| } | |
| ] | |
| const listUsers = (user) => { | |
| return user.map((item) => { | |
| return ( | |
| ` | |
| <li> | |
| <span>${ item.id }</span> | |
| <span>${ item.name }</span> | |
| </li> | |
| ` | |
| ) | |
| }).join('') | |
| } | |
| const listView = document.querySelector('[data-list]'); | |
| listView.innerHTML = listUsers(users) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment