Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPEhtml>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8"/>
- <title>About Me</title>
- </head>
- <body>
- </body>
- </html>
- <script>
- function Book (title,author,alreadyRead) {
- this.title=title;
- this.author=author;
- this.alreadyRead=alreadyRead;
- }
- var BookList=new Array ();
- BookList.push=(new Book("Game of Thrones" , "George RR Martin" ,true));
- BookList.push=(new Book("The Girl Before" , "JP Delany" ,true));
- BookList.push=(new Book("Forget me not" , "Ena Rosa" ,true));
- BookList.push=(new Book("Origin" , "Dan Brown" ,false));
- BookList.push=(new Book("The Sun and her flowers" , "Rupi Kaur" ,false));
- BookList.push=(new Book("The Midnight Line" , "Lee Child/" ,false));
- for(var i = 0 ; i<BookList.length; i++)
- {
- if(BookList[i].alreadyRead)
- {
- document.write("You have already read " + BookList[i].title + "by " + BookList[i].author + "<br>");
- }
- else
- {
- document.write("You still need to read " + BookList[i].title + " by " + BookList[i].author +"<br>");
- }
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement