Q:

executing nested 'while' loops within promises

I am trying to create some nested 'while' loops within my promises.  I start to run into trouble in my innerFunc when I am executing log.asyncCall().then(...) my IDE is telling me that right away, the arrow function will jump straight to the .then() containing return innerFunc() without even going into the if statement.  I think the race conditions are not executing in the order I want them to. 
Summary of what I am trying to achieve:
According to outerFunc I want to perform innerFunc this 3 times.  
What innerFunc does call .asyncCall() over and over again as long as log is NOT null.  If innerFunc cannot produce log, exit the 'while' loop. 
I'm also having trouble finding a good way to debug promises.  I am currently using the debug feature with WebStorm.  
var i = 0 
const outerFunc = () => {
  return new Promise(resolve => {
    if (i < 3) {
      i++
      const innerFunc = () => {
        return new Promise(resolve => {
          return log.asyncCall().then(lg => {
            if (lg) {
              // some logic
            } else {
              resolve()
            }
          }).then(() => {
            // continue iterating innerFunc()
            return innerFunc();
          });
        })
      };
      // first iteration innerFunc()
      return innerFunc().then(() => {
        // once innerFunc() is complete, reiterate outerFunc()
        return outerFunc();
      });
    } else {
      resolve();
    }
  });  
}

A:

You are using a Promise anti-pattern, since you're wrapping a promise in another promise. 
I would strongly advise taking innerFunc out of the inner scope, and rewriting it thus:
const doLogging = () => {
    return log.asyncCall().then(result => {
        if (result) {
            // do stuff
            ...
            return doLogging();
        }
    });
}

There's no need for an else branch - the inner arrow function will implicitly return undefined which will then be wrapped by .then into a Promise. 
You then want to run this count times:
const repeatPromise = (f, count) => {
    if (count > 0) {
        return f().then(() => repeatPromise(f, count - 1));
    } else {
        return Promise.resolve();
    }
}

const outerFunc = () => repeatPromise(doLogging, 3);

In this function the else branch is necessary to ensure that the final result is always a Promise. 
(NB: as written the repeatPromise function won't work properly if the passed function doesn't return a Promise)

