Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/466.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
javascript对象问题_Javascript_Jquery - Fatal编程技术网

javascript对象问题

javascript对象问题,javascript,jquery,Javascript,Jquery,我试图模仿mongodb map reduce function some_function(){ .... call_some (some_object); .... } function call_some (some_object){ // In here, // How could I use this keyword instead of some_object? // some_object.something => this.

我试图模仿mongodb map reduce

function some_function(){
    ....
    call_some (some_object);
    ....
}

function call_some (some_object){
    // In here,
    // How could I use this keyword instead of some_object?
    // some_object.something => this.something
}

在javascript或jquery中,使用的调用

或者,如果您不想以特殊方式调用它,请尝试以下方法:

function call_some(some_object) {
    if(this !== some_object) {
        return call_some.apply(some_object, arguments);
    }
    // do something interesting here
    // this === some_object
}
function call_some(some_object) {
    if(this !== some_object) {
        return call_some.apply(some_object, arguments);
    }
    // do something interesting here
    // this === some_object
}