1
1

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.

Amber Smalltalk で引数が複数の JavaScript のメソッドを呼ぶ

Last updated at Posted at 2015-12-21

 KLab アドベントカレンダーの記事を書いていて困ったことネタです。

 引数が一つの場合は console.log('hello world')console log: 'hello world' のように書き換えれば良いのですぐに見当がつくのですが、jqObj.css('background', 'red') のように引数が複数ある場合はどうすれば良いでしょうか?
 実は jqObj css: 'background' color: 'red' だろうが jqObj css: 'background' hogehoge: 'red' だろうが最初のキーワードが JavaScript のメソッド名にさえなっていれば、第二引数以降はキーワードはなんでも良いみたいです。ずこー。

 良く見るとドキュメントにもちゃんと書いてあるんですけどね…。流し読みしていて見逃しちゃいました。

1
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?