Posts tagged ‘single quotes’

Should I Use Single Quotes or Double Quotes in Salesforce Lightning Components?

A question came up in a recent DEV601 (Programming Lightning Components) class regarding the use of single quotes vs. double quotes in Lightning Components.

After a discussion in the Salesforce University DEV601 Chatter group and some quick experimentation, the conclusion I came to is that the Lightning Component Framework, which was built on the Aura UI Framework, looks at quotes in the same manner JavaScript in general looks at quotes – it simply doesn’t care whether you use single quotes or double quotes.

Even though the framework itself will accept single quotes or double quotes for most operations, as an instructor and advisor I want to ensure that we teach good programming practices. In response, I have come up with some guidelines and recommendations for the use of quotes in Lightning Component code.