2
0

More than 3 years have passed since last update.

プロパティ名がキーと一致しているときは省略して書ける

Last updated at Posted at 2019-11-25

表題の件、コードレビューで教えていただいた :pray:

キー名と変数名が同じなら省略できる :pencil: (簡単なことかもだけどすぐ忘れそうなのでメモ)

修正前

const data = await this.SampleRequest({ id: id })

修正後

const data = await this.SampleRequest({ id })

参考

あなたが知らないJavaScriptの便利すぎるショートハンド19選 - WPJ

2
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
2
0