Use double quotes and not working. Single quotes and it's working....wait but why?


So here is the jquery code which didn't work :

var main=function()

and here is the error: > "Oops, try again. Use the line $('.icon-menu').click(); inside your main function."
It worked just fine with single quotes though.
I assumed it does not matter as long as opening and closing quotes are both either single or double. Can we only use single quotes and not double ?


Hi Rahul,

Single versus double quotes won't affect JavaScript/jQuery code in real life, but on Codecademy this lesson has a poorly done SCT (Submission Correctness Test; code checker), so you have to be careful and use single quotes most of the time here :confused:


Thanks Zystvan. That helped :smile: