Open
Conversation
dardecena
approved these changes
Sep 24, 2025
dardecena
left a comment
There was a problem hiding this comment.
Good work! Let's go over exercise 2 together some time this week.
| // TODO substitute your own name for "HackYourFuture" | ||
| const myName = 'HackYourFuture'; | ||
|
|
||
| const myName = "HackYourFuture"; |
There was a problem hiding this comment.
Don't forget to read the requirements. It asks here to replace "HackYourFuture" with your name.
Comment on lines
1
to
2
| export function calculateDogAge(humanYears) { | ||
| return humanYears * 7; |
There was a problem hiding this comment.
Nice try. You are almost there.
Take another look at the requirements, the function should return a string. What does your function 'calculateDogAge' return?
Comment on lines
6
to
14
| const myAge = 25; | ||
| console.log( | ||
| `If you are ${myAge} years old, that's ${calculateDogAge(myAge)} in dog years!` | ||
| ); | ||
|
|
||
| const yourAge = 40; | ||
| console.log( | ||
| `If you are ${yourAge} years old, that's ${calculateDogAge(yourAge)} in dog years!` | ||
| ); |
There was a problem hiding this comment.
This is not necessary, the function 'calculateDogAge' should return the console.log(). Think about the string that is the expected result, and where in the code it should be triggered.
Comment on lines
+15
to
+18
| const numKids = [0, 1, 2, 3, 4]; | ||
| const partnerNames = ["Alex", "Sam", "Taylor", "Jordan", "Casey"]; | ||
| const locations = ["Amsterdam", "Rotterdam", "Utrecht", "The Hague", "Eindhoven"]; | ||
| const jobTitles = ["developer", "designer", "teacher", "engineer", "chef"]; |
Comment on lines
+6
to
+11
| export function tellFortune(numKids, partnerNames, locations, jobTitles) { | ||
| return `You will be a ${selectRandomly(jobTitles)} in ${selectRandomly( | ||
| locations | ||
| )}, married to ${selectRandomly(partnerNames)} with ${selectRandomly( | ||
| numKids | ||
| )} kids.`; |
Comment on lines
+2
to
+3
| function selectRandomly(arr) { | ||
| return arr[Math.floor(Math.random() * arr.length)]; |
dardecena
approved these changes
Oct 17, 2025
dardecena
left a comment
There was a problem hiding this comment.
Great job Rim. Thanks for making the corrections
|
|
||
| function main() { | ||
| const myName = "HackYourFuture"; | ||
| const myName = "Rim"; |
| console.log(giveCompliment(myName)); | ||
|
|
||
| const yourName = "Amsterdam"; | ||
| const yourName = "Hadid"; |
Comment on lines
+2
to
+3
| const dogYears = humanYears * 7; | ||
| return `Your doggie is ${dogYears} years old in dog years!`; |
Comment on lines
+7
to
+9
| console.log(calculateDogAge(1)); | ||
| console.log(calculateDogAge(2)); | ||
| console.log(calculateDogAge(3)); |
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.
No description provided.