How to use print() for dialogue. How to update the string?


Hey there, great question, and glad to hear that the syntax of JavaScript is becoming 2nd nature!

There isn’t a way to delete a print command that has already executed, but you can still print another string, which should be good enough.

Because you want to print the string only when the ball has been tapped, you can add the print command to the callback function for the event handler. It would look like this:

ball.on('click', () => {
    print('you chose the ball instead of the square!');

Hope this helps!