|
4 | 4 |
|
5 | 5 | — Facebook (the creators/maintainers of this thing)
|
6 | 6 |
|
| 7 | +--- |
| 8 | + |
7 | 9 | ## Assumptions
|
8 | 10 |
|
9 |
| -This assumes you already are familiar with ES6, especially arrow functions, const vs let, and object destructuring. |
| 11 | +This assumes you already are familiar with ES6, especially ... |
| 12 | + |
| 13 | +- Variable declaration with `const` and `let` |
| 14 | +- Arrow functions `const getRandomBool = () => Math.random() >= 0.5;` |
| 15 | +- Object shorthand `const key = "value"; const obj = { key };` |
| 16 | +- Object destructuring `const { key } = obj;` |
| 17 | +- Array destructuring `const [item] = arr;` |
| 18 | +- Array spread operator `const copy = [...arr];` |
| 19 | +- .map array method `const itemNames = items.map(item => item.name);` |
| 20 | +- String template literals |
| 21 | + |
| 22 | +```js |
| 23 | +// variable declaration with const or let |
| 24 | +const dontChangeMyType = 1; |
| 25 | +let goAheadChangeMe = 1; |
| 26 | +goAheadChangeMe = false; |
| 27 | +// object shorthand |
| 28 | +const key = "value"; |
| 29 | +const obj = { key }; |
| 30 | +// object destructuring |
| 31 | +const object = { keyName: "val" }; |
| 32 | +const { keyName } = object; |
| 33 | +// arrow functions |
| 34 | +const getRandomBool = () => Math.random() >= 0.5; |
| 35 | +// array spread operator |
| 36 | +const arr = [{ name: "Steve" }, { name: "Alicia" }]; |
| 37 | +const people = [...arr, { name: "Bob" }]; |
| 38 | +// .map array method |
| 39 | +const names = people.map(person => person.name); |
| 40 | +// array destructuring |
| 41 | +const [steve, alicia, bob] = names; |
| 42 | +// string template literals |
| 43 | +const greeting = `Hey, ${steve}!`; |
| 44 | +``` |
| 45 | + |
| 46 | +--- |
10 | 47 |
|
11 |
| -## What is it? |
| 48 | +## What is React? |
12 | 49 |
|
13 | 50 | React allows you to build an app interface out of a composition of **components** (written in **JSX**).
|
14 | 51 |
|
|
0 commit comments