Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. <script id="jsbin-javascript">
  2. var book1;
  3. var book2;
  4. var getBookInfo;
  5. var buildBook;
  6.  
  7. buildBook= function(author,title){
  8. return {
  9. author:author,
  10. title:title
  11. };
  12. };
  13.  
  14. getBookInfo = function(book){
  15. return book.author + "created the masterpiece, " + book.title; };
  16.  
  17. book1= buildBook("JK Rowling","Harry Potter");
  18. book2= buildBook("Matthew Stevens","The Arc");
  19.  
  20. console.log(getBookInfo(book1));
  21. console.log(getBookInfo(book2));
  22. </script>
  23.  
  24.  
  25. <script id="jsbin-source-javascript" type="text/javascript">var book1;
  26. var book2;
  27. var getBookInfo;
  28. var buildBook;
  29.  
  30. buildBook= function(author,title){
  31. return {
  32. author:author,
  33. title:title
  34. };
  35. };
  36.  
  37. getBookInfo = function(book){
  38. return book.author + "created the masterpiece, " + book.title; };
  39.  
  40. book1= buildBook("JK Rowling","Harry Potter");
  41. book2= buildBook("Matthew Stevens","The Arc");
  42.  
  43. console.log(getBookInfo(book1));
  44. console.log(getBookInfo(book2));
  45. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement