Sheffield | 26-ITP-Jan | Mahammad Osman | Sprint 3| Quote generator#1165
Open
Darkidd77 wants to merge 4 commits intoCodeYourFuture:mainfrom
Open
Sheffield | 26-ITP-Jan | Mahammad Osman | Sprint 3| Quote generator#1165Darkidd77 wants to merge 4 commits intoCodeYourFuture:mainfrom
Darkidd77 wants to merge 4 commits intoCodeYourFuture:mainfrom
Conversation
jayshreehajgude2012
left a comment
There was a problem hiding this comment.
Good use of inbuild functions.
Work on cleanliness of the code.
Explore more DOM methos to access elemnts.
| <title>Title here</title> | ||
| <link rel="stylesheet" href="style.css" /> | ||
| <title>Quote generator app</title> | ||
| <script defer src="quotes.js"></script> |
There was a problem hiding this comment.
JavaScript File linked correctly to html.
|
|
||
| // You don't need to change this function | ||
| function pickFromArray(choices) { | ||
| return choices[Math.floor(Math.random() * choices.length)]; |
There was a problem hiding this comment.
inbuilt functions correctly used.
| // call pickFromArray with the quotes array to check you get a random quote | ||
|
|
||
| // getting the input and button elements from the page | ||
| const quoteElement = document.getElementById("quote"); |
There was a problem hiding this comment.
document.getElementById() is one of the way of accessing DOM elements. You can explore more DOM methods.
|
|
||
| function displayRandomQuote() { | ||
| // get a random quote from the quotes array | ||
| const randomQuote = pickFromArray(quotes); |
There was a problem hiding this comment.
pickFromArray(quotes) used correctly.
| displayRandomQuote(); // display a random quote when the page loads | ||
|
|
||
| // display a new random quote when button is clicked | ||
| buttonElement.addEventListener("click", () => { |
There was a problem hiding this comment.
Event handler used correctly.
Comment on lines
438
to
447
| quote: | ||
| "It's your place in the world; it's your life. Go on and do all you can with it, and make it the life you want to live.", | ||
| author: "Mae Jemison", | ||
| }, | ||
| { | ||
| quote: | ||
| "You may be disappointed if you fail, but you are doomed if you don't try.", | ||
| author: "Beverly Sills", | ||
| }, | ||
| { |
There was a problem hiding this comment.
You can work on cleanliness of code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Learners, PR Template
Self checklist
Changelist