What is diffrence made by insertion of quotes?


#1

Hello All,

When I return a true/false value without double quotes , code works

However ,if I return a true/false value with double quotes , code throws error i.e
Oops, try again. Your function returns true for 3!

Why do quotes insertion cause this ?
And y does return statement under else if condition with quotes doesnt throw error

Kindly guide me.
Thank You

Regards
Yugantika


#2

Hey,

true and false are Booleans, they don't need quotes.

Strings use quotes

Read more - CodeCademy glossary


#3

Oh ! I see.
Thankyou Zainabrawat.:relaxed:


#4

No problem, you're welcome !
Happy Learning :slightly_smiling:
Happy coding !

What inspired you to learn programming ?
Join the discussion