Values, Names, and Text (Summary)

Congratulations, you made it to the end of the course! You started with a bare 6 in the terminal that could have meant six guests, six pizzas, or six dollars. You finished with a function that works out a whole pizza party bill and writes the message for the group chat, and you checked its results against numbers you calculated yourself.

Along the way, you met the three things that most programs do with data. They give values names, calculate with them, and turn the results into text that people can read.

What You Can Do Now

In this course, you learned how to:

  • Name a value and point the name somewhere new. You created variables with let, pictured each name as a tag tied to a value, and traced what every name points at after each line. You also updated a name from its own current value, like the running game night score. JavaScript works out the right-hand side first.
  • Choose const or let for each name. A const name never moves, so readers can trust it, and JavaScript stops you with a TypeError if a line tries to move it anyway. You saved let for names that change.
  • Turn a small brief into calculations. You predicted results with several operators, used parentheses to change the order, shared slices fairly with / and %, and kept totals up to date with compound assignment.
  • Build readable text. You joined strings with +, put quotes and newlines inside them with escapes, and saw why "5" + "5" gives "55". Then you switched to template literals, which drop values and calculations straight into a message, dollar signs included.
  • Read characters by position. You counted positions from zero, found the last character with length - 1 or at(-1), and got undefined for a position the string doesn’t have.
  • Check a result against a requirement. You worked out expected results on paper before running any code, used the size of a mismatch as a clue, and picked boundary and invalid cases for your trip budget. When the brief was silent, you made a decision instead of inventing an answer.

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Become a Member to join the conversation.