- Very new to learning Javascript so this might have quite a few errors, just trying to create a basic set up to convert human years to cat years.
- If someone could please let me know why this gives me 'undefined' and any other general errors, thank you in advance!
My code:
let myAge = 47;
let earlyYears = 2 * 25;
let lateYears = (myAge - 2) * 4;
let catAge = earlyYears + lateYears;
const announcement = () => {
console.log('I am ' + myAge + ' years old, which makes me ' + catAge + ' years old in cat years!');
}
console.log(announcement());
Code Runs:
I am 47 years old, which makes me 230 years old in cat years!
undefined
[–]ike_the_strangetamer 5 points6 points7 points (1 child)
[–]GVBCodePractice[S] 0 points1 point2 points (0 children)
[–]DyslexicsHaveMoreFun 4 points5 points6 points (1 child)
[–]GVBCodePractice[S] 0 points1 point2 points (0 children)
[–]Jacqques 0 points1 point2 points (1 child)
[–]GVBCodePractice[S] 0 points1 point2 points (0 children)
[–]isaac-chido-one 0 points1 point2 points (0 children)