Created
September 30, 2016 01:48
-
-
Save ccckmit/30d4a783a07aa4fe7f37d7940e3172a3 to your computer and use it in GitHub Desktop.
test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 第一種寫法,直接宣告函數 | |
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