thecodezone.
The Code Zone
Short steps, at your pace · Free lessons and practice · Member video walkthroughs
Save your next small win.

Checking your account…

02.04 · Variables / Practice · 3 min

Make the values yours

Use clear names to change what your program says.

Activity 4 of 5 in Variables

All courses

JavaScript Basics / 02.04

Make the values yours

Not started

Change two assigned values and check the messages your program prints.

More options
Rob changes a learner profile card, checks the named values in his program, and sees the updated profile.
Rob’s comic strip · Variables

Choose const and let deliberately

Work through 4 focused steps. Read the explanation, type each requested change and check it before moving on. Your own code carries forward.

The mini-lesson opens in a new tab. Your own code carries forward; each step has a focused check and an optional hint.

Start mini-lesson(opens in a new tab)

4 steps · Saved work · Instant feedback

YOUR TURN

Make the values yours.

Change the learner name to Ada and the completed-lesson count to 1. Keep the two console.log instructions using their variable names.

Expected output
Ada
1

Keep the starting inputs. Print these lines in this order, without extra output.

Edit JavaScript, then run it. Check Challenge shows which output checks pass or need a fix. Word wrap is enabled.

Ready to checkRun the checks to see your results here.

Work in VS Code instead

Copy the starter into a file named practice.js in VS Code. If Node.js is installed, open the terminal in that folder and run node practice.js. Compare the output with the task above. Automated challenge checks are available in the browser editor.

Code example
example.jsjavascript · example
const learnerName = "Rob";
let completedLessons = 0;

console.log(learnerName);
console.log(completedLessons);

Need a nudge?

Change the values, not the messages

The values are assigned on the first two lines. Leave the variable names in the console.log instructions.

Text and numbers look different

Put Ada inside quotes. The number 1 does not need quotes.

Reveal a possible solution
One possible solution
example.jsjavascript · example
const learnerName = "Ada";
let completedLessons = 1;

console.log(learnerName);
console.log(completedLessons);

The console reads the values through their names. Changing an assignment changes the value used later. Check that your logs still use learnerName and completedLessons rather than hard-coded answers.

Replace your editor code?

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

Ready to try it?

Practice in your browser and see your results.

Progress details

Have a question?

Ask the Code Zone community.

Ask a question in The Code Zone (opens in a new tab)

Continue learning

ONE STEP FORWARD

A clear name makes a value easier to use and a program easier to understand.