Spaces or commas? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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/

25th Jul 2018, 11:58 PM
Emeruche Ikenna Cole
Emeruche Ikenna Cole - avatar
1 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.
26th Jul 2018, 12:40 AM
Hoàng Nguyễn Văn
Hoàng Nguyễn Văn - avatar