search

Home  >  Q&A  >  body text

node.js - nodejs express module.exports问题

我知道模块化可以这么写:

module.exports = {
    a: function(){
        console.log("这是a");
    },
    b: function(){
        console.log("这是b");
    }
}

请问可以这么写吗?

module.exports = function(){
    console.log("这是模块");
}
怪我咯怪我咯2786 days ago292

reply all(1)I'll reply

  • 大家讲道理

    大家讲道理2017-04-17 15:41:12

    ....Can't you just try it yourself? There is an object everywhere above and a function everywhere below. . . Any questions? practice. . Out of true knowledge. . .

    reply
    0
  • Cancelreply