Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>JS Bin</title>
- </head>
- <body>
- <h1>Joe Bliss</h1>
- <script id="jsbin-javascript">
- 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 addContact = function(newContact) {
- contacts.push(newContact);
- return contacts
- };
- addContact( {'firstName': 'John'
- 'lastName' : 'Doe'
- 'phone' : '(512) 355-0453'
- 'email' : 'johndoe@email.com'});
- var listContact = function(contacts){
- for(var i = 0; i < contacts.length; i++){
- console.log('firstName');
- console.log('lastName');
- }
- }
- var search = function(name){
- for(var i = 0; i <= contatcs.length; i++){
- if('firstName' && 'lastName' == name){
- return name
- }
- }
- }
- console.log('contacts');
- listContact();
- </script>
- <script id="jsbin-source-javascript" type="text/javascript">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 addContact = function(newContact) {
- contacts.push(newContact);
- return contacts
- };
- addContact( {'firstName': 'John'
- 'lastName' : 'Doe'
- 'phone' : '(512) 355-0453'
- 'email' : 'johndoe@email.com'});
- var listContact = function(contacts){
- for(var i = 0; i < contacts.length; i++){
- console.log('firstName');
- console.log('lastName');
- }
- }
- var search = function(name){
- for(var i = 0; i <= contatcs.length; i++){
- if('firstName' && 'lastName' == name){
- return name
- }
- }
- }
- console.log('contacts');
- listContact();</script></body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement