0

I have a javascript function like below. The first console.log statement works as expected. However the second console.log statement outputs no values. Could you please help me understand why this is happening. Thanks

function testOutputs() {
  let testReasons = []
  
  testScreen.getReasons().find('li').each(($el) => {
    testReasons.push($el.text())
    console.log("Display Array Contents 1 : " + testReasons.toString())
  })
  
  console.log("Display Array Contents 2 : " + testReasons.toString())
}
Dave Newton
  • 158,873
  • 26
  • 254
  • 302
El Kid
  • 1
  • 1

0 Answers0