Introduction to JavaScript (Multiple Choice Quiz)


Hi guys, very new here. Just started with JavaScript courses.
Stumbled upon this question in the Pro Trial Quiz under track.

Which of the following statements returns false?

  • 'myName'.length > 2
  • 4/2 == 2
  • 3 *4<15
  • 'InputControl'.length < 4

First question, is ' ' acceptable vs " " for quoting strings in Javascript?
If yes, then choice no.4 would seem quite wrong.
For choice no.2, isn't it supposed to be === right?

Thks for the help!


Both the types of quotations are acceptable.


== and === are both acceptable in this example as you are checking for equality. There is a difference between them tho, I suggest you read this if you are wanting to know.


To expand on equality,


will coerce the value on the right to match the type on the left, if possible.

1 == "1"   =>  true

since the value on the right can be coerced to a number type.


Does not rely upon coercion, and will return type mismatch error if the types are not identical.

==   =>  equality

===  =>  identity


Wow, that is real fast!

Thanks for the fast reply @oscartbeamish, certainly boast my motivation to learn some coding by myself! Appreciated! :smile:


Hi @mtf thanks for the explanation! Guess I have lots of reading to do! Just starting from ground zero.


Just come across this note:

String: Any grouping of words or numbers surrounded by single quotes: ' ... ' or double quotes " ... ".

in track

It was not mentioned in track (the older track)

Just want to mention this for those who are checking out the differences between two tracks, the side notes differ as well. :sweat_smile: