What am I missing to compute the age? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What am I missing to compute the age?

let birthYear = 1992 var currentYear = 2020 var age = “currentYear - birthYear” print (age) https://code.sololearn.com/cu0mR44SRmcN/?ref=app

31st May 2020, 10:06 PM
Alex
1 Answer
+ 1
You have to remove the quotes around your calculation. Everything in quotes is a string and will not be calculated.
31st May 2020, 10:15 PM
Sandra Meyer
Sandra Meyer - avatar