Spaces or commas? | Sololearn: Learn to code for FREE!

+1

Spaces or commas?

Hello. In this lesson, Solo said we should use spaces not commas. In previous lesson, they said use commas bot spaces. Different lessons though. But how does one know which method or action to use commas or spaces in jquery and JavaScript https://www.sololearn.com/learn/jQuery/2796/

7/25/2018 11:58:57 PM

Emeruche Ikenna Cole

1 Answer

New Answer

+2

Can you link to the lesson? Spaces in a selector indicate the latter is a descendant of the former element. It also seperate different CSS properties. These selectors/values are passed as strings, as it is not of JS syntax (CSS actually) and needs to be parsed by JQuery. The comma is used for seperating parameters or arguments, chaining variable definitions, and many more.