thecodezone.
The Code Zone

JAVASCRIPT / NUMBERS · STEP 1 OF 3

Convert a supplied text reply before calculating

GUIDED PRACTICE

Convert a supplied text reply before calculating

Follow the current step, write the requested code and choose Run & check this step. Your own program carries forward.

Your code stays in one editor through every step. Word wrap is enabled.

Step 1 of 3

Model a terminal reply safely

Readline receives text. This browser practice supplies a fixed reply so you can test the conversion without a Node.js terminal. The separate terminal example still uses real input.

Your task

In script.js, make the changes in the checklist. Keep the working code from earlier steps.

To pass this step:

  • Declare const reply = "24";.

Press the play button labeled Run & check this step below the editor to run your code and see your check results.

A hint for this step

Use the exact names and values in the checklist. Compare the new line with the pattern explained above, then check your code.

Your editor is opening.

Each step builds on the last. Finish the current step before opening the next one; your code stays with you.

Code and completed steps save in this browser when signed out. Sign in to save across devices.

Resources for this step

Looking things up is part of programming. Compare these explanations with the task, then return and try the idea in your own code.

Ready to checkRun the checks to see your results here.

Replace your editor code?

Your current work will be replaced. Choose Cancel to keep it.