Why Save and not Run?


#1

Hi guys. Can someone tell me - why I have only "Save" button in this project. But don't have a "Run" button. So I can try my code only with Developer tools in browser.


Help with javascript 8 ball project
#2

The code should run automatically as soon as you save it. To run in your own console, it would be advisable to write the code inside a function so it can be run multiple times.

Paste the function into the console command line and hit Enter.

function magic_8_ball(userQuestion) {
    // code
}

Then call the function with a user question.

magic_8_ball("Will I pass my Calculus exam, tomorrow?");

The function will remain in memory until you end the session (close the browser window) so you can call it as much and as often as you like.

We cannot edit content in the console's memory, only replace it. Edit and save your code with a text editor, then paste the function back into the console.