Detecting the end of a method chaining
It's not problematic in the sense that _endChain will always be called after the whole chain. In fact you could simplify the code by only creating the timer once:



var a = {
  _timer: null,
  _resetTimer: function() {
    if (!this._timer)
     this._timer = window.setTimeout(this._endChain.bind(this), 0);
  },




But the problem will come with code that follows for example:

a.A().B().B().A();
DoMoreStuff();


Most developers would be surprised to find that the first call has not completed. I think the better solution would be to implement an end method which is what many libraries do:

let result = a.A().B().B().A().end();
DoMoreStuff();


Or a promise like method:

a.A().B().B().A().then( function(result) {
  DoMoreStuff();
});