问题 I have the following code: openTokInit() { this.session = OT.initSession(this.tokboxApiKey, this.sessionId); const self = this; this.session.on('connectionCreated', function(event) { self.connectionCount++; }); if (this.connectionCount < 2) { this.session.connect(this.token, err => { if (err) { reject(err); } else { resolve(this.session); } }); } The problem is that when the if statement runs, the connectionCount is always 0, because the 'connectionCreated' event is fired a few seconds later.