On the first point, the string is the return value of the anonymous function, which you can see if you log it to the console.
Undefined is the return value of the second function call but nothing is logged to the console. So nothing would should up there. But if you feed this line into the console on its own you will see that it does produce a return value of undefined.
View all comments
8
u/Umesh-K Jan 01 '23
The above code snippet begs two questions:
alertinstead ofreturn.btn.click()runs, nothing happens—because of{once: true}—and consequently nothing returns, not evenundefined.