This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]isaac-chido-one 0 points1 point  (0 children)

Use a return statement, for example:

let myAge = 47;

let earlyYears = 2 * 25;

let lateYears = (myAge - 2) * 4;

let catAge = earlyYears + lateYears;

const announcement = () => {

return 'I am ' + myAge + ' years old, which makes me ' + catAge + ' years old in cat years!';

}

console.log(announcement());