Heim  >  Artikel  >  Web-Frontend  >  DayMG) von DaysOfJavaScript

DayMG) von DaysOfJavaScript

王林
王林Original
2024-07-17 17:22:27542Durchsuche

DayMG)of DaysOfJavaScript

Stück für Stück ist besser als perfekt, nicht wahr?

Was ich getan habe

  • Schauen Sie sich das Video weiter an Lernen Sie JavaScript

Was ich gelernt habe

Tag3

Doppelte Gleichheit und strikte Gleichheit.

console.log(10 == 10); // True
console.log(10 == "10"); // True
console.log(10 === 10); // True
console.log(10 === "10"); // False

Tag4

Wechsel erinnert.

var hoge;

switch(hoge) {
  case 1:
    console.log("hoge"); // If hoge == 1, output will be "hoge" and "hogehoge"
  case 2:
    console.log("hogehoge"); // If hoge == 2, output will be "hogehoge"
    break;
  case 3:
    console.log("fuga"); // If hoge == 3, output will be "fuga"
    break;
}

Tag5

Gelerntes Objekt.

var exampleObject = {
  "hoge": "ほげ",
  "hogehoge": "ほげほげ",
  "fuga": "ふが",
}
/* Dictionary in Python might be similar data structure?
We can add a content with operation like below*/
exampleObject.fugafuga = "ふがふが";
// or...
exampleObject["fugafuga"] = "ふがふが";
// If additional element is same as last element, additional one is ignored.
// (It's just my guess. I've googled but I couldn't find information about it)

Das obige ist der detaillierte Inhalt vonDayMG) von DaysOfJavaScript. Für weitere Informationen folgen Sie bitte anderen verwandten Artikeln auf der PHP chinesischen Website!

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn