mise à jour javascript
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
9c849a5eac
commit
c6938fb311
@ -254,7 +254,7 @@ setTimeout(() => {
|
||||
### 6.2 Promesses
|
||||
``` { .js .copy }
|
||||
fetch("https://api.example.com/data")
|
||||
.then(response => response. { .js .copy }on())
|
||||
.then(response => response.json())
|
||||
.then(data => console.log(data))
|
||||
.catch(error => console.error(error));
|
||||
```
|
||||
@ -303,7 +303,7 @@ import { addition } from "./fichier. { .js .copy }";
|
||||
async function getData() {
|
||||
try {
|
||||
const response = await fetch("https://api.example.com/data");
|
||||
const data = await response. { .js .copy }on();
|
||||
const data = await response.json();
|
||||
console.log(data);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
@ -317,5 +317,5 @@ async function getData() {
|
||||
|
||||
- [MDN JavaScript Guide](https://developer.mozilla.org/fr/docs/Web/JavaScript/Guide)
|
||||
- [JavaScript.info](https://javascript.info/)
|
||||
- [W3Schools JavaScript](https://www.w3schools.com/ { .js .copy }/)
|
||||
- [W3Schools JavaScript](https://www.w3schools.com/js/)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user