mardi 19 juin 2018

Why is this javascript loop with If not working?

The below for loop is not working for some reason, I have tried it with =, == and === in the if statements. For loop is never executed.

What am I doing wrong?

for (let j = 0; j < array.length; j++) {
  elm.isPresent()
    .then((result) =>
      console.log(result))
  if (result === true) {
    elm.getText()
      .then((text) =>
        text
      )
  } else {
    scrollToRow()
      .then(() =>
        elm.getText()
        .then((text) =>
          text
        )
      )
  }
}

Aucun commentaire:

Enregistrer un commentaire