>= 18? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

>= 18?

Hello, Link is below. One of the bonus questions was to write a simple code to see if someone was 18 or older. var adult => 18; console.log(adult == 20); https://www.sololearn.com/learning/1024/1132/1385/2 Not sure why, but I keep getting an error message? Any help appreciated.

17th Jan 2021, 7:59 AM
tristach605
tristach605 - avatar
4 Answers
+ 2
Maybe you mean like this? var adult = 20; console.log(adult >= 18); = is used for assignment of variables and values. == > < >= <= are used for comparisons.
17th Jan 2021, 8:07 AM
noteve
noteve - avatar
+ 2
Please tag relevant programming language. java !== javascript Thank you.
17th Jan 2021, 10:27 AM
🇮🇳Vivek🇮🇳
🇮🇳Vivek🇮🇳 - avatar
+ 1
Thanks Vivek and Nicko12, -Half way there. -The formula says okay for large numbers and not small or vice versa? -I messed around again, but couldn't find anything. -Anymore ideas? -I'll be sure to post with the correct tag this time too. https://www.sololearn.com/learning/1024/1132/1385/2
18th Jan 2021, 8:01 AM
tristach605
tristach605 - avatar
0
Thanks for your help, solution is below (I was making it too difficult and only had to write the final portion in the form of a console.log statement:)). https://www.sololearn.com/learning/1024/1132/1385/1
18th Jan 2021, 11:25 PM
tristach605
tristach605 - avatar