6
9

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.

javascript:既存の関数を拡張する(処理を追加する)

Posted at

<例>aaa()という関数を拡張し、bbb()という関数の処理を追加しています。

使用方法
var aaa = function(){
 alert("aaa");
}

var bbb = function(){
 alert("bbb");
}

var old = aaa;
aaa = function(){
	old();
	bbb();
}

// 実行
aaa();
6
9
2

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
6
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?