Fragen

  1. Welche der folgenden Bezeichner sind gültig, welche nicht und warum?

    $someVariable
    _someVariable
    1Variable
    some_variable
    somèvariable
    function
    .someVariable
    some*variable
  2. Wandeln Sie die folgenden Bezeichner anhand der im ersten Abschnitt des Kapitels beschriebenen Konventionen um:

    var some_month;
    function theMonth // Funktion, die den aktuellen Monat zurückgibt
    current_month // eine Konstante
    var summer_month; // ein Array mit Sommermonaten
    MyLibrary_afunction // eine Funktion aus einem JavaScript-Paket
  3. Ist das folgende String-Literal gültig? Wenn nicht – wie würden Sie es korrigieren?

    var someString = 'Wer hat einmal gesagt: "Only two things are infinite, the universe
    and human stupidity, and I'm not sure about the former."';
  4. Was für JavaScript-Code ...

Get Einführung in JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.