Method chaining: Difference between revisions

Content deleted Content added
m a template
 
Line 37:
 
Compare:
<syntaxhighlight lang="cpp">
a << b << c;
</syntaxhighlight>
equivalent to:
<syntaxhighlight lang="cpp">
a << b;
a << c;
Line 47:
 
Another example in [[JavaScript]] uses the built-in methods of Array:
<syntaxhighlight lang="javascript">filter
const interesting_products = products
somethings
.filter(x => x.count > 10)
.sort((a, b) => a.count - b.count)