0
0

More than 1 year has passed since last update.

JavaScript で if - else ってどう書くんだっけ?

Last updated at Posted at 2022-08-16

もう100回以上忘れては調べる、をやっている気がしています。あらためて見てみると c と同じなんですね。(演算子はちょっと違う)

const myadd = "Shinjuku";

if (myadd === "Setagaya") {
  console.log("Setagaya");
} else if (myadd === "Suginami") {
  console.log("Suginami");
} else {
  console.log("Other");
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0