Skip to content

Instantly share code, notes, and snippets.

@civic
Created April 16, 2013 10:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save civic/5394787 to your computer and use it in GitHub Desktop.
Save civic/5394787 to your computer and use it in GitHub Desktop.
例えば非同期処理のcallback関数などにあえて関数名をつけるのはどうだろう?
//例えば非同期処理のcallback関数などにあえて関数名をつけるのはどうだろう?
someAjaxFunction("parmaeter",
function 販売価格の取得に成功した時(calculatedSalesPrice){
console.log(calculatedSalesPrice);
},
function なんかエラー(e){
console.log(e);
}
);
//変更前
someAjaxFunction("parmaeter",
function(calculatedSalesPrice){
console.log(calculatedSalesPrice);
},
function(e){
console.log(e);
}
);
//同様にコメントの代わりに関数にして即実行とか
(function 三角形を描画(){
gc.draw(....);
gc.draw(....);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment