Skip to content

Commit bfcdffb

Browse files
committed
additional examples for function grouping style
1 parent 26f79cb commit bfcdffb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,18 @@ When calling functions, omit the parentheses on the final method call in a chain
223223

224224
foo(4).bar 8
225225

226-
You will sometimes see parentheses used to group functions (instead of being used to group function parameters). An example of using this style (hereafter referred to as the "function grouping style"):
226+
You will sometimes see parentheses used to group functions (instead of being used to group function parameters). Examples of using this style (hereafter referred to as the "function grouping style"):
227227

228228
($ '#selektor').addClass 'klass'
229229

230+
(foo 4).bar 8
231+
230232
This is in contrast to:
231233

232234
$('#selektor').addClass 'klass'
233235

236+
foo(4).bar 8
237+
234238
The correct way to apply the function grouping style when chaining is to use it for the initial call only:
235239

236240
($ '#selektor').addClass('klass').hide() # Yes

0 commit comments

Comments
 (0)