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アウトプット1日目

Posted at

JavaScriptnアウトプット1日目

  1. 文字の出力
## 文字の出力 - 書き方
console.log('Hello World!!')
  • 出力
Hello World!!

変数名を利用した出力

  • 書き方
item = 'Hello'
console.log(`${item} World!`)

-出力

Hello World!

if文

  • 書き方
const number = 1;

//偶数奇数判定
if (number % 2 === 0) {
  console.log("even number");
} else {
  console.log("odd number");
}
  • 出力
odd number
  • 省略形
(number % 2 === 0)?console.log("even number"):  console.log("odd number");

for文

  • 入力
for (let i = 0; i <= 10; i++) {
  console.log(i);
}
  • 出力
0
1
2
3
4
5
6
7
8
9
10

関数

const add(a, b) {
  return a + b;
}
substitute_value = add(1,2)
console.log(substitute_value)
  • 出力
3
  • 省略形
const add = (a, b) => a + b;
0
0
1

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?