GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Quiz

Scope

Code Ramp 5 Fragen

Quiz starten

Dieses Quiz enthält Fragetypen, die sich im gewohnten Player öffnen.

Fragen in diesem Quiz (5)

  1. 1Variables that are created within the body of a function are available only in the context of that function. This is referred to as [blank_start]local[blank_end] scope.
    1. Alocal
    2. Bglobal
  2. 2In the following block of code, what is part of the scope that is local to the function?

    var tax = 0.08;
    function calculateTotal(subtotal) {
    var total = subtotal + (subtotal * tax);
    return total;
    }

    console.log(calculateTotal(50));
    1. Atax
    2. Bsubtotal
    3. Ctotal
    4. DcalculateTotal
  3. 3In the following block of code, what is part of the global scope?

    var tax = 0.08;
    function calculateTotal(subtotal) {
    var total = subtotal + (subtotal * tax);
    return total;
    }

    console.log(calculateTotal(50));
    1. Atax
    2. Bsubtotal
    3. Ctotal
    4. DcalculateTotal
  4. 4Shadowing is when we accidentally override (or shadow) the value of a variable inside a function.
    1. ARichtig
    2. BFalsch
  5. 5What kind of error is thrown when we try to access a local variable in the global scope? (Hint: If you're not sure, go try it out in your JavaScript console first!)
    1. AReference Error
    2. BSyntax Error
    3. CType Error

Informationen

Beschreibung
Quiz am Scope, erstellt von Code Ramp am 02/06/2018.
Sprache
English
Aufrufe
265
Schlagwörter
toefl
Bewertung
Noch keine Bewertungen
Bewerte dieses Quiz
Bewerte dieses Quiz

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck