29th Oct 2024, 2:29 PM
Sina
4 Antworten
+ 3
In JavaScript, for conditional statement, you'll need to use "==" or "===", not "=". Use "==" on the if/else condition instead of "=" and it should work. Also, you can achieve this using array as well, here is an example: https://sololearn.com/compiler-playground/W031jmw5y32a/?ref=app
29th Oct 2024, 3:01 PM
Shihan
Shihan - avatar
+ 3
Your code needs a few adjustments: use = for assignments, === for comparisons, and consider using an array for month names. Make sure the age calculation accounts for whether the birthday has passed this year, and improve the message for invalid month inputs.
29th Oct 2024, 6:11 PM
Hamid Ahmad Amini
Hamid Ahmad Amini - avatar
+ 1
what to fix? it asks 2 questions, and accept anything
29th Oct 2024, 2:54 PM
Mihaly Nyilas
Mihaly Nyilas - avatar
0
thanks for helping
29th Oct 2024, 3:07 PM
Sina