diff --git a/resources/docs/docs/chapters/tp/arrow-functions.md b/resources/docs/docs/chapters/tp/arrow-functions.md index 625646398e4b558f48a61a816656338456082242..475d99ea069c35d1de78f925b14f41e3ed3244bb 100644 --- a/resources/docs/docs/chapters/tp/arrow-functions.md +++ b/resources/docs/docs/chapters/tp/arrow-functions.md @@ -75,9 +75,10 @@ Waiting a certain amount of time can be easily done using the [`setTimeout()`](h > **danger** Regular functions declared with the **`function` keyword have `this` inherited from the caller**, whereas **arrow functions have a `this` inherited from the declaring scope**. <details><summary> Show the game.js file </summary> + === "game.js - with function" - ```javascript + ``` js export class GameComponent { goToScore() { // ... @@ -100,7 +101,7 @@ Waiting a certain amount of time can be easily done using the [`setTimeout()`](h === "game.js - with arrow function" - ```javascript + ``` js export class GameComponent { goToScore() { // ... @@ -117,6 +118,28 @@ Waiting a certain amount of time can be easily done using the [`setTimeout()`](h } } ``` +=== "C" + + ``` c + #include <stdio.h> + + int main(void) { + printf("Hello world!\n"); + return 0; + } + ``` + +=== "C++" + + ``` c++ + #include <iostream> + + int main(void) { + std::cout << "Hello world!" << std::endl; + return 0; + } + ``` + </details> ## Template literals @@ -158,3 +181,4 @@ src/app/scripts/welcome.js - [ ] I know what is the _bound this_ of a function - [ ] I know about template literals - [ ] The application runs as usual +