Skip to content
Snippets Groups Projects
Commit 6ebbe7e0 authored by Olivier ABDELNOUR's avatar Olivier ABDELNOUR
Browse files

wip

parent a520329b
No related branches found
No related tags found
No related merge requests found
Pipeline #59999 passed
......@@ -76,14 +76,36 @@ Waiting a certain amount of time can be easily done using the [`setTimeout()`](h
<details><summary> Show the game.js file </summary>
=== "game.js - with function"
``` js
export class GameComponent {
goToScore() {
// ...
setTimeout(
function () {
=== "game.js - with function"
``` js
export class GameComponent {
goToScore() {
// ...
setTimeout(
function () {
const scorePage = "#score";
scorePage +
"?name=" +
this._name +
"&size=" +
this._size +
"&time=" +
timeElapsedInSeconds;
}.bind(this),
750
);
}
}
```
=== "game.js - with arrow function"
``` js
export class GameComponent {
goToScore() {
// ...
setTimeout(() => {
const scorePage = "#score";
scorePage +
"?name=" +
......@@ -92,44 +114,12 @@ Waiting a certain amount of time can be easily done using the [`setTimeout()`](h
this._size +
"&time=" +
timeElapsedInSeconds;
}.bind(this),
750
);
}
}
```
=== "game.js - with arrow function"
``` js
export class GameComponent {
goToScore() {
// ...
setTimeout(() => {
const scorePage = "#score";
scorePage +
"?name=" +
this._name +
"&size=" +
this._size +
"&time=" +
timeElapsedInSeconds;
}, 750);
}, 750);
}
}
}
```
</details>
```
:::tabbed
@A
```js
console.log("coucou");
```
@B
```js
console.log("coucou");
```
:::
</details>
## Template literals
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment