Guest User

Untitled

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