From 428e8fc2da8769d945af0186ace9c31b47ff02dc Mon Sep 17 00:00:00 2001 From: James Bunt Date: Thu, 24 Apr 2014 09:49:06 +1200 Subject: [PATCH] Note on escaping single quotes in strings. --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 3409c68ccd..bf89d656c7 100644 --- a/README.md +++ b/README.md @@ -191,6 +191,12 @@ var fullName = 'Bob ' + this.lastName; ``` + - Escape single quotes in strings + + ```javascript + var myDonut = 'That donut doesn\'t belong to you, it\'s mine!'; + ``` + - Strings longer than 80 characters should be written across multiple lines using string concatenation. - Note: If overused, long strings with concatenation could impact performance. [jsPerf](http://jsperf.com/ya-string-concat) & [Discussion](https://github.com/airbnb/javascript/issues/40)