Introduction
Function scope means variables created inside a function only exist inside that function. This helps keep things organized and avoids mistakes.
When you want to keep a variable private to a function so other parts of your code can't change it.
When you want to reuse the same variable name in different functions without conflicts.
When you want to make sure temporary data is removed after a function finishes running.