mirror of
https://github.com/microsoft/Web-Dev-For-Beginners.git
synced 2025-08-06 06:47:50 +02:00
Merge branch 'main' into ko_translation
This commit is contained in:
@@ -139,7 +139,7 @@ function displayDone() {
|
||||
console.log('3 seconds has elapsed');
|
||||
}
|
||||
// timer value is in milliseconds
|
||||
setTimeout(3000, displayDone);
|
||||
setTimeout(displayDone, 3000);
|
||||
```
|
||||
|
||||
### Anonymous functions
|
||||
@@ -151,9 +151,9 @@ When we are passing a function as a parameter we can bypass creating one in adva
|
||||
Let's rewrite the code above to use an anonymous function:
|
||||
|
||||
```javascript
|
||||
setTimeout(3000, function() {
|
||||
setTimeout(function() {
|
||||
console.log('3 seconds has elapsed');
|
||||
});
|
||||
}, 3000);
|
||||
```
|
||||
|
||||
If you run our new code you'll notice we get the same results. We've created a function, but didn't have to give it a name!
|
||||
@@ -165,9 +165,9 @@ One shortcut common in a lot of programming languages (including JavaScript) is
|
||||
Let's rewrite our code one more time to use a fat arrow function:
|
||||
|
||||
```javascript
|
||||
setTimeout(3000, () => {
|
||||
setTimeout(() => {
|
||||
console.log('3 seconds has elapsed');
|
||||
});
|
||||
}, 3000);
|
||||
```
|
||||
|
||||
### When to use each strategy
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
[](https://youtube.com/watch?v=XgKsD6Zwvlc "Methoden und Funktionen")
|
||||
|
||||
## [Pre-Lecture Quiz](.github/pre-lecture-quiz.md)
|
||||
## [Pre-Lecture Quiz](../.github/pre-lecture-quiz.md)
|
||||
|
||||
Wenn wir darüber nachdenken, Code zu schreiben, möchten wir immer sicherstellen, dass unser Code lesbar ist. Während dies nicht intuitiv klingt, wird Code viel öfter gelesen als geschrieben. Ein Kernwerkzeug in der Toolbox eines Entwicklers, um wartbaren Code sicherzustellen, ist die **Funktion**.
|
||||
|
||||
@@ -184,7 +184,7 @@ Sie haben jetzt gesehen, dass wir drei Möglichkeiten haben, eine Funktion als P
|
||||
|
||||
Können Sie den Unterschied zwischen Funktionen und Methoden in einem Satz artikulieren? Versuche es!
|
||||
|
||||
## [Quiz nach der Vorlesung](.github/post-lecture-quiz.md)
|
||||
## [Quiz nach der Vorlesung](../.github/post-lecture-quiz.md)
|
||||
|
||||
## Review & Selbststudium
|
||||
|
||||
@@ -192,4 +192,4 @@ Es lohnt sich, [etwas mehr über Pfeilfunktionen zu lesen](https://developer.moz
|
||||
|
||||
## Zuordnung
|
||||
|
||||
[Spaß mit Funktionen](assignment.md)
|
||||
[Spaß mit Funktionen](assignment.de.md)
|
@@ -2,7 +2,7 @@
|
||||
|
||||
[](https://youtube.com/watch?v=XgKsD6Zwvlc "Métodos y funciones")
|
||||
|
||||
## [Pre-lecture prueba](.github/pre-lecture-quiz.md)
|
||||
## [Pre-lecture prueba](../.github/pre-lecture-quiz.md)
|
||||
|
||||
Cuando necesite su código para realizar una tarea, utilizará un método o una función. Analicemos las diferencias.
|
||||
|
||||
@@ -89,11 +89,11 @@ Cualquier parámetro con valores predeterminados debe estar al final de la lista
|
||||
🚀 Desafío:
|
||||
|
||||
|
||||
## [Post-lecture prueba](.github/post-lecture-quiz.md)
|
||||
## [Post-lecture prueba](../.github/post-lecture-quiz.md)
|
||||
|
||||
## Revisión y autoestudio
|
||||
|
||||
TODO
|
||||
|
||||
**Tarea**: [Práctica de tipos de datos](assignment.md)
|
||||
**Tarea**: [Práctica de tipos de datos](assignment.es.md)
|
||||
|
||||
|
Reference in New Issue
Block a user