Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width">
- <title>JS Bin</title>
- </head>
- <body>
- <script id="jsbin-javascript">
- // Write your code below this line
- var contacts = [
- {firstName: "John",
- lastName: "Doe",
- phone: "(512) 355-0453",
- email: "johndoe@email.com"},
- {firstName: "Jane",
- lastName: "Doe",
- phone: "(312) 641-2203",
- email: "janedoe@email.com"
- },
- {firstName: "Suzie",
- lastName: "Smith",
- phone: "(415) 604-4219",
- email: "suziesmith@email.com"
- }]
- var listcontacts = function(){
- for(var i = 0; i < contacts.length; i++){
- var firstName = contacts[i].firstName;
- var lastName = contacts[i].lastName;
- console.log(firstName + " " + lastName);
- }
- }
- listcontacts();
- </script>
- <script id="jsbin-source-javascript" type="text/javascript">// Write your code below this line
- var contacts = [
- {firstName: "John",
- lastName: "Doe",
- phone: "(512) 355-0453",
- email: "johndoe@email.com"},
- {firstName: "Jane",
- lastName: "Doe",
- phone: "(312) 641-2203",
- email: "janedoe@email.com"
- },
- {firstName: "Suzie",
- lastName: "Smith",
- phone: "(415) 604-4219",
- email: "suziesmith@email.com"
- }]
- var listcontacts = function(){
- for(var i = 0; i < contacts.length; i++){
- var firstName = contacts[i].firstName;
- var lastName = contacts[i].lastName;
- console.log(firstName + " " + lastName);
- }
- }
- listcontacts();
- </script></body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement