You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-2Lines changed: 26 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -293,12 +293,20 @@ let coercion: Double = "1.234e2"; // coercion of string to double
293
293
294
294
##### Strings
295
295
296
-
A fundamental part of creating programs is working with textual data. As in other languages, we use the type string to refer to these textual types. Strings are represented by characters between either a single quote or a double quote. When characters are between double quotes they are interpolated, meaning they have expressions evaluated within them. These expressions start with the dollar character. All strings can span multiple lines.
296
+
A fundamental part of creating programs is working with textual data. As in other languages,
297
+
we use the type string to refer to these textual types. Strings are represented by characters
298
+
between either a single quote or a double quote. When characters are between double quotes they
299
+
are interpolated, meaning they have expressions evaluated within them. These expressions start
300
+
with the dollar character. All strings can span multiple lines.
297
301
298
302
```js
299
303
let string ='Hello World!'; // literal string
300
304
let template ="The sum of 1 and 2 is ${1 + 2}"; // interpolated string
301
305
let concat ="The sum of 1 and 2 is "+ (1+2); // concatenation
306
+
let multiline ="Details
307
+
a) This is a new line
308
+
b) This is another new line";
309
+
302
310
```
303
311
304
312
##### Arrays
@@ -323,6 +331,13 @@ let list = [1, 2, 3]; // creates an ArrayList
323
331
let map = {"a":1, "b":2}; // creates a LinkedHashSet
The for statement is typically used to count over a range of numeric values. It contains three parts, a declaration, a condition, and an optional statement which is evaluated at the end of the loop.
522
+
The for statement is typically used to count over a range of numeric values. It contains three parts, a
523
+
declaration, a condition, and an optional statement which is evaluated at the end of the loop.
508
524
509
525
```js
510
526
for(let i =0; i <10; i++){ // loops from 1 to 10
@@ -532,6 +548,14 @@ for(e in 0..9) { // iterates from 0 to 9
0 commit comments