Skip to content

Instantly share code, notes, and snippets.

@ccckmit
Created September 30, 2016 01:48
Show Gist options
  • Save ccckmit/30d4a783a07aa4fe7f37d7940e3172a3 to your computer and use it in GitHub Desktop.
Save ccckmit/30d4a783a07aa4fe7f37d7940e3172a3 to your computer and use it in GitHub Desktop.
test
// 第一種寫法,直接宣告函數
function sub(a,b) {
return a-b;
}
// 第二種寫法,將匿名函數指定給變數。
var add = function(a,b) {
return a+b;
}
console.log("add(3,5)=", add(3,5), " sub(7,2)=", sub(7,2));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment