SOURCE

function doSomething(msg, callback){
    console.log(msg);
    if(typeof callback == "function") 
    callback();
 } 
doSomething("回调函数", function(){
    console.log("匿名函数实现回调!");
 }); 
console 命令行工具 X clear

                    
>
console