Guest User

Untitled

a guest
Nov 18th, 2017
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width">
  6. <title>JS Bin</title>
  7. </head>
  8. <body>
  9.  
  10. <script id="jsbin-javascript">
  11. // Write your code below this line
  12. contacts = [
  13. {
  14. firstName: 'John',
  15. lastName: 'Doe',
  16. phone: '(512) 355-0453',
  17. email: 'johndoe@email.com'
  18. },
  19. {
  20. firstName: 'Jane',
  21. lastName: 'Doe',
  22. phone: '(312) 641-2203',
  23. email: 'janedoe@email.com'
  24. },
  25. {
  26. firstName: 'Suzie',
  27. lastName: 'Smith',
  28. phone: '(415) 604-4219',
  29. email: 'suziesmith@email.com'
  30. }
  31. ];
  32.  
  33. var x = contacts.length;
  34. var log = console.log
  35.  
  36. function listContacts() {
  37. for (i=0; i < x; i++) {
  38. log(contacts[i].name);
  39. }
  40. }
  41. </script>
  42.  
  43.  
  44.  
  45. <script id="jsbin-source-javascript" type="text/javascript">// Write your code below this line
  46. contacts = [
  47. {
  48. firstName: 'John',
  49. lastName: 'Doe',
  50. phone: '(512) 355-0453',
  51. email: 'johndoe@email.com'
  52. },
  53. {
  54. firstName: 'Jane',
  55. lastName: 'Doe',
  56. phone: '(312) 641-2203',
  57. email: 'janedoe@email.com'
  58. },
  59. {
  60. firstName: 'Suzie',
  61. lastName: 'Smith',
  62. phone: '(415) 604-4219',
  63. email: 'suziesmith@email.com'
  64. }
  65. ];
  66.  
  67. var x = contacts.length;
  68. var log = console.log
  69.  
  70. function listContacts() {
  71. for (i=0; i < x; i++) {
  72. log(contacts[i].name);
  73. }
  74. }</script></body>
  75. </html>
Add Comment
Please, Sign In to add comment