Rumah > Artikel > hujung hadapan web > DayMG) daripada DaysOfJavaScript
Sedikit demi sedikit lebih baik daripada sempurna bukan?
Dua sama dan ketat sama.
console.log(10 == 10); // True console.log(10 == "10"); // True console.log(10 === 10); // True console.log(10 === "10"); // False
Suis diingati.
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; }
Objek Dipelajari.
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)
Atas ialah kandungan terperinci DayMG) daripada DaysOfJavaScript. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!