var: Variables declared with var are function-scoped. This means they are only accessible within the function where they are declared. If a variable is declared outside any function, it becomes a global variable.
let: Variables declared with let are block-scoped. They are limited to the block, statement, or expression where they are declared. This includes loops, conditionals, and functions.