From 50e6a1571d8801750507e7127814f93ea8a2eb55 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sat, 14 Oct 2017 01:19:47 +0300 Subject: [PATCH] Typos --- 1-js/05-data-types/03-string/article.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/1-js/05-data-types/03-string/article.md b/1-js/05-data-types/03-string/article.md index 8f8a40c5..b74399a9 100644 --- a/1-js/05-data-types/03-string/article.md +++ b/1-js/05-data-types/03-string/article.md @@ -19,7 +19,7 @@ let double = "double-quoted"; let backticks = `backticks`; ``` -Single and double quotes are essentially the same. Backticks however allow us to embed any expression into the string, including function calls: +Single and double quotes are essentially the same. Backticks, however, allow us to embed any expression into the string, including function calls: ```js run function sum(a, b) { @@ -89,7 +89,7 @@ Examples with unicode: ```js run alert( "\u00A9" ); // © alert( "\u{20331}" ); // 佫, a rare chinese hieroglyph (long unicode) -alert( "\u{1F60D}"); // 😍, a smiling face symbol (another long unicode) +alert( "\u{1F60D}" ); // 😍, a smiling face symbol (another long unicode) ``` All special characters start with a backslash character `\`. It is also called an "escape character". @@ -166,7 +166,7 @@ alert( str.charAt(1000) ); // '' (an empty string) We can also iterate over characters using `for..of`: ```js run -for(let char of "Hello") { +for (let char of "Hello") { alert(char); // H,e,l,l,o (char becomes "H", then "e", then "l" etc) } ``` @@ -379,8 +379,8 @@ There are 3 methods in JavaScript to get a substring: `substring`, `substr` and ```js run let str = "stringify"; - alert( str.slice(0,5) ); // 'strin', the substring from 0 to 5 (not including 5) - alert( str.slice(0,1) ); // 's', from 0 to 1, but not including 1, so only character at 0 + alert( str.slice(0, 5) ); // 'strin', the substring from 0 to 5 (not including 5) + alert( str.slice(0, 1) ); // 's', from 0 to 1, but not including 1, so only character at 0 ``` If there is no second argument, then `slice` goes till the end of the string: @@ -548,7 +548,7 @@ For instance: alert( 'Österreich'.localeCompare('Zealand') ); // -1 ``` -This method actually has two additional arguments specified in [the documentation](mdn:js/String/localeCompare), which allow it to specify the language (by default taken from the environment) and setup additional rules like case sensivity or should `"a"` and `"á"` be treated as the same etc. +This method actually has two additional arguments specified in [the documentation](mdn:js/String/localeCompare), which allows it to specify the language (by default taken from the environment) and setup additional rules like case sensitivity or should `"a"` and `"á"` be treated as the same etc. ## Internals, Unicode