What's in the room stays in the room
In a house, things in the shared living room are available to everyone, but what's in your bedroom is yours. Variables work the same way. Where a variable is created decides who can see it — that's its scope.
Inside and outside
const shop = "Sikau Café";
function makeBill() {
const total = 450;
console.log(shop + ": Rs " + total);
}
makeBill();
console.log(shop);
// console.log(total); ← would be an errorOne-way glass: A function can look out at variables around it, but code outside can't look in at the function's own variables.