I was wondering since I'm trying to use use strict
, does it matter if I go with "use strict"
or 'use strict'
?
Is any of those a «more correct» option?
Actually in Javascript using double quotes or single quotes doesn't change anything.
It's more important you use the same option in your entire code.
Even if you use mixed quotes it will not change anything:
'use strict' var myString = "double quotes string"
So using use strict
with double quotes or single quotes are the same.
In many libraries they commonly use one of them for strings and another to avoid escape, like in this example:
'A string that\'s single quoted' "a string that's double quoted"
So specifically in English sometimes is useful using double quotes instead of single quotes to avoid this kind of escape thing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With