我基本上想在下面的代码中工作,有没有办法?
var hash_table = new Object();
hash_table['a'] = foo;
alert(hash_table['a'](1)); // 1 is just a simple parameter for example.
// this line should print "2" in alert();.
function foo(params) {
alert("params: " + params); // just simple print in alert(); (will print 1)
return 2;
}