Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script id="jsbin-javascript">
- var book1;
- var book2;
- var getBookInfo;
- var buildBook;
- buildBook= function(author,title){
- return {
- author:author,
- title:title
- };
- };
- getBookInfo = function(book){
- return book.author + "created the masterpiece, " + book.title; };
- book1= buildBook("JK Rowling","Harry Potter");
- book2= buildBook("Matthew Stevens","The Arc");
- console.log(getBookInfo(book1));
- console.log(getBookInfo(book2));
- </script>
- <script id="jsbin-source-javascript" type="text/javascript">var book1;
- var book2;
- var getBookInfo;
- var buildBook;
- buildBook= function(author,title){
- return {
- author:author,
- title:title
- };
- };
- getBookInfo = function(book){
- return book.author + "created the masterpiece, " + book.title; };
- book1= buildBook("JK Rowling","Harry Potter");
- book2= buildBook("Matthew Stevens","The Arc");
- console.log(getBookInfo(book1));
- console.log(getBookInfo(book2));
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement