JavaScript-Quiz: Functions & Arrow Functions

This JavaScript quiz checks the different ways to define a function. You will predict what arrow functions return, see which functions can be called before their line and learn what arrow functions can't do.

Leicht 10 Fragen ~5 Minuten Bestanden ab 80% Node.js 22

Modus wählen

Du spielst als Gast: Melde dich an, damit XP und Serie gespeichert werden.

Beispielfrage

Frage 1 von 10

What does this print?

const double = (n) => n * 2;
console.log(double(4));
Lösung zeigen

A. 8 An arrow function with no braces returns its expression automatically. So double(4) returns 4 * 2, which is 8.

Darum geht es in diesem Quiz

  • Function declarations, expressions and arrow functions
  • Implicit return in arrow functions, and when braces need return
  • Returning an object literal from an arrow function
  • Missing arguments become undefined
  • Functions as values in arrays and callbacks

Häufige Fragen

Brauche ich ein Konto?

Nein. Jeder kann spielen. Mit Anmeldung werden XP, Serie, Abzeichen und Verlauf gespeichert.

Kann ich es wiederholen?

Ja. Dein Bestwert bleibt erhalten, und Fragen und Antworten werden jedes Mal neu gemischt.