-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
review requested #1
base: for-review
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for cyf-junitalama-tv ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good job!!!!
script.js
Outdated
@@ -1,12 +1,100 @@ | |||
//You can edit ALL of the code here | |||
const allEpisodes = getAllEpisodes(); | |||
function setup() { | |||
const allEpisodes = getAllEpisodes(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you have declared allEpisodes above, so i think you can skip this line of code as it is repeated
script.js
Outdated
divEle.append( | ||
episodeName, | ||
lineEle, | ||
image, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i learn from you too :) i didn't know you can add them all at one go, cool!!
let options = document.createElement("option"); | ||
options.value = el.name; | ||
options.innerText = `${el.name} - S${el.season.toString().padStart(2, "0")}E${el.number.toString().padStart(2, "0")}`; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wise approach for padStart()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job getting everything working up to level-300!
I think it was optional anyway, but the only thing missing in terms of functionality is being able to easily go back to seeing all episodes after using the dropdown - the only way to get them back right now is to start typing and then delete again.
I think in terms of style/readability, it's good to break up code into some smaller sub-functions - it can make the code much easier to read (because usually a function says what it does), and easier for you to think about too. There is a lot happening in these functions! And the 300 level bit could be put ("encapsulated") in a function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I left a few comments
script.js
Outdated
const searchInput = searchEle.value.toLowerCase(); | ||
const filteredEpisodes = allEpisodes.filter(episode => { | ||
if (episode.name.toLowerCase().includes(searchInput) || episode.summary.toLowerCase().includes(searchInput)){ | ||
return episode; | ||
} | ||
}) | ||
document.querySelector("#num").innerText = filteredEpisodes.length; | ||
makePageForEpisodes(filteredEpisodes); | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here the indentation looks a bit flat, like the last 3 lines start at the same line, but they are not at the same scope level.
"program": "${workspaceFolder}/script.js" | ||
} | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VS code settings are usually not committed, you could add this file to your gitignore.
Great job!💯🏅 |
No description provided.