(Werbung, bitte nicht blockieren.)

Quizze » Aufrufbare Werte

1. Funktionsaufrufe

function callIt(func) {
  func();
}

Welche der folgenden Ausdrücke lösen Ausnahmen aus?

2. new

function newIt(constr) {
  new constr();
}

Welche der folgenden Ausdrücke lösen Ausnahmen aus?

3. Standardwerte für Parameter

function foo(x=true, y) {
  return [x, y];
}
const result = foo('a', 'b', 'c');

Was passiert?

4. Standardwerte für Parameter

function foo(x=true, y) {
  return [x, y];
}
const result = foo('a', 'b');

Was passiert?

5. Standardwerte für Parameter

function foo(x=true, y) {
  return [x, y];
}
const result = foo('a');

Was passiert?

6. Standardwerte für Parameter

function foo(x=true, y) {
  return [x, y];
}
const result = foo();

Was passiert?

7. Rest-Parameter

function f(x, ...y) {
  return [x, y];
}
const result = f('a', 'b', 'c');

Was passiert?

8. Rest-Parameter

function f(x, ...y) {
  return [x, y];
}
const result = f();

Was passiert?

9. Syntax von Pfeilfunktionen

Welche der folgenden Ausdrücke sind syntaktisch korrekt?


Richtige Antworten0von0