JavaScript小笔记
function test1 () {
console.log('test1');
}
function test2 () {
console.log('test2');
}
function test3 (test3) {
console.log(test3);
}
function start(type){
var arr=[test1,test2,test3];
var op=arr[type]
if (op) op(123);
}
start(2);