如何在JAVASCRIPT中实现将数据传递给param?

function test(){
   data = 'Hi'

   function then(func){
   func = function...

*... << this part is where I am strugging >> ...*


    }

    test.then = then;
}

test();
test.then(function(param){
    console.log(param);         // result: Hi
})

如何在测试函数的then方法中实现将内部值作为参数获取?帮帮我!

评论