cal*_*tie 8 javascript node.js express
我在express中检查了respons.js的代码并遇到了这段代码:
res.contentType =
res.type = function(type){
return this.set('Content-Type', ~type.indexOf('/')
? type
: mime.lookup(type));
};
Run Code Online (Sandbox Code Playgroud)
我的问题是~运营商在type.indexOf()声明面前做了什么?它的用途是什么,何时使用?