我的Git bash里结果显示怎么老是乱行,有时候还会少显示个字?
为什么我的是这样的? 显示到第三行就这样了
var eventEmitter = require('events').EventEmitter
var life = new eventEmitter()
life.setMaxListeners(11)
function water(who){
console.log('给' + who + '倒水')
}
life.on('求安慰',water)
life.on('求安慰',function(who){
console.log('给' + who + '揉肩')
})
life.on('求安慰',function(who){
console.log('给' + who + '做饭')
})
life.on('求安慰',function(who){
console.log('给' + who + '洗衣服')
})
life.on('求安慰',function(who){
console.log('给' + who + '。。。5')
})
life.on('求安慰',function(who){
console.log('给' + who + '。。。6')
})
life.on('求安慰',function(who){
console.log('给' + who + '。。。7')
})
life.on('求安慰',function(who){
console.log('给' + who + '。。。8')
})
life.on('求安慰',function(who){
console.log('给' + who + '。。。9')
})
life.on('求安慰',function(who){
console.log('给' + who + '。。。10')
})
life.on('求安慰',function(who){
console.log('给' + who + '你想累死我啊!')
})
life.on('求溺爱',function(who){
console.log('给' + who + '买衣衣')
})
life.on('求溺爱',function(who){
console.log('给' + who + '交工资')
})
life.on('求溺爱',function(who){
console.log('给' + who + '交 话 费')
})
life.removeListener('求安慰',water)
var hasConfortListener = life.emit('求安慰','汉子')
var hasLovedListener = life.emit('求溺爱','妹子')
console.log(life.listeners('求安慰').length)
console.log(life.listeners('求溺爱').length)
console.log(eventEmitter.listenerCount(life,'求安慰'))