ES5写法
//index.js
var {num}= require('./content.js')
num(1+2)//3
//content.js
const num = function(a,b){
return parseInt(a)+parseInt(b)
}
module.exports = {num}
ES6写法
//content.js
exports.default = {
num(a,b){
return parseIn
}
}
//index.js
import {num} from './content.js