1 function say(word) { 2 console.log(word); 3 } 4 5 function execute(someFunction, value) { 6 someFunction(value); 7 } 8 9 execute(say, "Hello");
网上找的一个经典的函数传递