Home > Web Front-end > JS Tutorial > body text

DayMG)of DaysOfJavaScript

王林
Release: 2024-07-17 17:22:27
Original
596 people have browsed it

DayMG)of DaysOfJavaScript

Little by little is better than perfect isn't it?

What I did

  • Continue watching the video Learn JavaScript

What I learned

Day3

Double equals and strict equal.

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

Day4

Remembered switch.

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;
}

Copy after login

Day5

Learned Object.

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)
Copy after login

The above is the detailed content of DayMG)of DaysOfJavaScript. For more information, please follow other related articles on the PHP Chinese website!

source:dev.to
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template