Skip to content

London | ITP-May-2025 | Hibo Sharif | Module-Data-Flows | Programmer Humour #277

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hibosharif202504
Copy link

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Briefly explain your PR.

Questions

Ask any questions you have for your reviewer.

@hibosharif202504 hibosharif202504 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 6, 2025
Comment on lines 6 to 24
function getComicData() {
fetch("https://xkcd.now.sh/?comic=latest")
.then(response => {
if (!response.ok) {
throw new Error(`Comic not available (status: ${response.status})`);
}

return response.json();
})
.then(data => {
console.log(data);
imgComic.src = data.img;
imgComic.alt = data.alt;
})

.catch (error => {
console.error("Error fetching comic:", error);
alert("Could not load the comic. Please try again later.");
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Indentation is off.

  • Why not take this opportunity to practice using async and await (instead of chaining .then())?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @cjyuan,

I have done the update on the code.

Thank you.

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Aug 9, 2025
@hibosharif202504 hibosharif202504 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 10, 2025
@cjyuan
Copy link
Contributor

cjyuan commented Aug 10, 2025

Changes look good!

@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Aug 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complete Volunteer to add when work is complete and all review comments have been addressed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants