Skip to content

Conversation

ZabihollahNamazi
Copy link

Just ignore the fetch commit please .
I have done both solutions in this branch.

Learners, PR Template

Self checklist

  • [ x] I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
  • 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.

@ZabihollahNamazi ZabihollahNamazi added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Dec 28, 2024

async function fetchData() {
try{
const response = await fetch("https://xkcd.now.sh/?comic=latest")
Copy link

Choose a reason for hiding this comment

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

Please, add closing semicolon at the end of your expressions. Though your JS will work, it prevents you from unexpected errors.

Copy link
Author

Choose a reason for hiding this comment

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

thanks


}

fetchData()
Copy link

Choose a reason for hiding this comment

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

Closing semicolon here please.

Copy link
Author

Choose a reason for hiding this comment

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

ok thanks

@tyzia tyzia added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Dec 28, 2024
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

Good work. I left you some comments and suggestions.

Comment on lines +11 to +15
const readLine = require('node:readline');
const reader = readLine.createInterface({
input: process.stdin,
output: process.stdout
});
Copy link
Contributor

Choose a reason for hiding this comment

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

I think in solution1.js, the program is expected to use the command line argument as input, so that one can run the code with an input string "Moo moo" as

node solution1.js "Moo moo"

The given link "Accept an argument" in readm.md is broken, but you can find similar guide from https://www.30secondsofcode.org/js/s/command-line-arguments/ (or use ChatGPT).

readline is for solution2.js.

// how will you account for the parameter being empty?

}

//4. Pipe argument into cowsay function and return a cow

// how will you log this to the console?
// node solution1.js
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the expectation are

  • In (3), cowSay(saying) should return a string that represents the cow saying the value of parameter saying.
  • In (4), output the cow to the console as console.log(cowSay(...)) where ... is the command line argument.

Comment on lines 19 to 22
let topLine = "_";
let bottomLine = "-";
let sayingWord = ``;
let cowAscii = `
Copy link
Contributor

Choose a reason for hiding this comment

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

It is better to

  • declare variables used only inside a function as local variables in the function
  • declare variables that do not change using const (e.g., cowAscii)

Copy link
Author

Choose a reason for hiding this comment

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

done

@tyzia tyzia added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Dec 31, 2024
@tyzia
Copy link

tyzia commented Jan 11, 2025

Stopped watching this PR for changes. If you will need my review for this PR in the future, please, ping me and add 'Needs review' label.

@ZabihollahNamazi ZabihollahNamazi 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. labels Jan 12, 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.

4 participants