https://jsfiddle.net/hzkmL879/
class ExampleClass {
constructor () {
// document.addEventListener('touchstart', this.StartSomething)
document.addEventListener('click', this.StartSomething)
}
StartSomething (e) {
console.log('Starting something..')
console.log(e)
console.log(this)
this.FinishSomething(e)
}
FinishSomething (e) {
alert('Finishing something!')
// e event is needed here for something..
}
}
new ExampleClass()
未捕获的TypeError:this.FinishSomething不是函数 在HTMLDocument.StartSomething