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?
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.
Shift
–
Batt No, in pretty much any code language, it does not matter whatsoever what type of quotes you use.
© 2022 - 2024 — McMap. All rights reserved.