LoginSignup
0
0

More than 3 years have passed since last update.

javascript 問題集 No.1 No.2 Arry.filter自作

Posted at

No.1
コマンド引数を読み取るにはprocess.argvを使う。
例えば

process.argv[2]

0と1はファイル名が読み取られているのでこのようになる。

process.argv.slice(2)とすると2より下の引数を呼び出すことができる。

No.2
この問題ではコマンド引数を数値にする必要があった。
そこで使ったのが

Number()

これで()の中身を数値にします。

今回は Number(process.argv[2])

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