Skip to content

Commit 9ec1c4a

Browse files
author
Cyril Walle
committed
tricks
1 parent 17e26e8 commit 9ec1c4a

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

js/tricks.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,17 @@ const minMax = function (numbers) {
2727
const localResult = Math.max(...numbers);
2828
results.push(localResult);
2929
}
30-
return results
30+
return results;
3131
};
3232
3333
```
3434

3535

36+
Array destructuring syntax can be used to swap variables;
37+
38+
```
39+
let a = 5;
40+
let b = 2;
41+
[a, b] = [b, a];
42+
```
43+

0 commit comments

Comments
 (0)