- 主题:this.ok = || function(obj) { return obj; }; 是啥意思?
var Promise = function(ok){
this.state = 'unfulfilled';
this.ok = || function(obj) { return obj; }; // <--
};
--
FROM 134.134.139.*
语法错误吧?
按上下文,应该是这样才对:
this.ok = ok || function(obj){return obj;};
意思是当ok参数没有被传进来的话就使用自定义的一个function。
【 在 dpblue (deep blue) 的大作中提到: 】
: var Promise = function(ok){
: this.state = 'unfulfilled';
: this.ok = || function(obj) { return obj; }; // <--
: ...................
--
修改:hgoldfish FROM 117.30.53.*
FROM 117.30.53.*
语法错误!
【 在 dpblue 的大作中提到: 】
: var Promise = function(ok){
: this.state = 'unfulfilled';
: this.ok = || function(obj) { return obj; }; // <--
: ...................
--
FROM 58.19.126.*