0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

JavaScript (ES5)基本の書き方 【swich, while】

Last updated at Posted at 2021-10-10

【条件分岐】
・swich

var item = "犬";

switch(item) {
  case "猫":
    console.log("にゃーと鳴きます");
    break;
  case "犬":
    console.log("ワンーと鳴きます");
    break;
  default:
  console.log("動物が存在しません");
} 

【繰り返し処理】
・while

var i = 1;

// while文を用いて、変数iが50未満のときに繰り返すループ文
while(i < 50) {
  console.log(i);
  i += 1;
}
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?