Let's start by giving a value a name. In TypeScript you use const to name a value you want to refer to later.

const greeting = 'Hello, World!';

console.log(greeting);

Does writing greeting make the text appear?

Showing it is console.log's job. Line 1 gives the name greeting to a string; line 3 hands that value to console.log. The semicolon just marks the end of a statement.

I could have written console.log('Hello, World!') directly.

If you only use it once, you could. Naming buys you two things: it says what the value is for, and it lets you reuse the same value as often as you like.

const unitPrice = 120;
const quantity = 3;
const totalPrice = unitPrice * quantity;

console.log(totalPrice);

That is much clearer than 120 * 3.

That is the point. A name explains the value. In TypeScript, camelCase — capitalizing each word boundary — is the usual style.

Can I change a value declared with const?

You cannot assign a different value to the same name. TypeScript stops you if you try.

const total = 100;

total = 200; // Cannot assign to 'total' because it is a constant.

So how do I write a value that does change?

For that you use let.

let count = 0;
count = count + 1;

console.log(count);

Still, reach for const by default. When only the values that truly change are declared with let, "this one moves" becomes visible just from reading the code.

Now that values have names, let's use them to calculate something.