Guest User

Untitled

a guest
Jan 19th, 2018
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 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.  
  13. var contacts = [
  14. {
  15. firstName: "John",
  16. lastName: "Doe",
  17. phone: "(512) 355-0453",
  18. email: "johndoe@email.com",
  19. },{
  20. firstName: "jane",
  21. lastName: "Doe",
  22. phone: "(312) 641-2203",
  23. email: "janedoe@email.com",
  24. },{
  25. firstName: "Suzie",
  26. lastName: "Smith",
  27. phone: "(512) 355-0453",
  28. email: "suziesmith@email.com",
  29. }
  30. ];
  31.  
  32. var listContacts = function () {
  33. for (i = 0; i < contacts.length; i++) {
  34. console.log(contacts[i].firstName + " " + contacts[i].lastName);
  35. }
  36. }
  37.  
  38. listContacts();
  39. </script>
  40.  
  41.  
  42.  
  43. <script id="jsbin-source-javascript" type="text/javascript">// Write your code below this line
  44.  
  45. var contacts = [
  46. {
  47. firstName: "John",
  48. lastName: "Doe",
  49. phone: "(512) 355-0453",
  50. email: "johndoe@email.com",
  51. },{
  52. firstName: "jane",
  53. lastName: "Doe",
  54. phone: "(312) 641-2203",
  55. email: "janedoe@email.com",
  56. },{
  57. firstName: "Suzie",
  58. lastName: "Smith",
  59. phone: "(512) 355-0453",
  60. email: "suziesmith@email.com",
  61. }
  62. ];
  63.  
  64. var listContacts = function () {
  65. for (i = 0; i < contacts.length; i++) {
  66. console.log(contacts[i].firstName + " " + contacts[i].lastName);
  67. }
  68. }
  69.  
  70. listContacts();
  71. </script></body>
  72. </html>
Add Comment
Please, Sign In to add comment