- When to use single quotes (’ ') and when double (" ")?
- Does numbers include negative?
This is a personal preference, I prefer the high visibility of double quotes myself. Also this is one thing that ES6 Template Literals help solve (its a better string!)
i dont know? but can someone please tell me
I personally think strings should be with double quotation marks even just for avoiding this simple error:
console.log('I don't like double quotation');
As per Airbnb Best Practices:-
We should use single quote strings as it is a Good Practice. You can still use double quotes but not a Good Practice.
But is there any good reason why?
If you want to print something covered with double quote you should use single quote to the console.
console.log ( ' I love "codecademy" ' )
Or if you want to print something covered with single quote you should use double quote to the console.
console.log ( " I Love 'codecademy' ")
Many other reasons may be there. I have found this at the beginning level of my learning js.