1
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 5 years have passed since last update.

code academy : js復習 ④

Posted at

topics
計算記号のショートカット
String型データの挿入

##記号のショートカット

let a = 5;
a += 3;
//a = 8

let b = 5;
b -= 3;
//b = 2

let c = 5;
c *= 3
//c = 15

let d = 5;
d ++;   //dに1がプラスされる
//d = 6

let e = 5;
d --   //eを1マイナス
//d = 4

##String型データの挿入

+を使う方法では""もしくは''くぎらないといけない

let name = "Taro";
console.log("私の名前は" + name + "です");
//output:私の名前はTaroです

"",''の代わりに、``(バックコート)を使い変数を挿入には${変数名}を利用する

let color = "";
console.log(`好きな色は${color}です`);
//output:好きな色は青です
1
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
1
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?