Skip to content

Conversation

@Hadidreem17
Copy link

No description provided.

Copy link

@dardecena dardecena 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! Let's go over exercise 2 together some time this week.

// TODO substitute your own name for "HackYourFuture"
const myName = 'HackYourFuture';

const myName = "HackYourFuture";

Choose a reason for hiding this comment

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

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;

Choose a reason for hiding this comment

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

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!`
);

Choose a reason for hiding this comment

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

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"];

Choose a reason for hiding this comment

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

👍

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.`;

Choose a reason for hiding this comment

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

👍

Comment on lines +2 to +3
function selectRandomly(arr) {
return arr[Math.floor(Math.random() * arr.length)];

Choose a reason for hiding this comment

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

👍

Copy link

@dardecena dardecena left a comment

Choose a reason for hiding this comment

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

Great job Rim. Thanks for making the corrections


function main() {
const myName = "HackYourFuture";
const myName = "Rim";

Choose a reason for hiding this comment

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

👍

console.log(giveCompliment(myName));

const yourName = "Amsterdam";
const yourName = "Hadid";

Choose a reason for hiding this comment

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

👍

Comment on lines +2 to +3
const dogYears = humanYears * 7;
return `Your doggie is ${dogYears} years old in dog years!`;

Choose a reason for hiding this comment

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

👍

Comment on lines +7 to +9
console.log(calculateDogAge(1));
console.log(calculateDogAge(2));
console.log(calculateDogAge(3));

Choose a reason for hiding this comment

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

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants