From 33363af613a6c8e9fa3958e7c90340e69e7db387 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Thu, 22 Jan 2015 17:38:38 -0800 Subject: [PATCH] put the dot with fn name when chaining --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6e7c6f1bc8..aee3ef7154 100644 --- a/README.md +++ b/README.md @@ -814,12 +814,21 @@ })(this);↵ ``` - - Use indentation when making long method chains. + - Use indentation when making long method chains. Use a leading dot, which + emphasizes that the line is a method call, not a new statement. ```javascript // bad $('#items').find('.selected').highlight().end().find('.open').updateCount(); + // bad + $('#items'). + find('selected'). + highlight(). + end(). + find('.open'). + updateCount(); + // good $('#items') .find('.selected')