-
Notifications
You must be signed in to change notification settings - Fork 287
Open
Description
C3D.create = function (obj) {
var _obj;
switch (typeof(obj)) {
case 'array':
_obj = {type: 'sprite', children: obj};
break;
case 'object':
_obj = obj;
break;
default:
return;
}
return createObj(_obj);
};这段代码里面使用了typeof(obj)来判断是否为数组。事实上typeof([])返回的是'object'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels