Can a function belong to just the block scope it is declared in?

If I declare a function inside an {…} block it is available outside the scope of the block.
Can functions be attached just to block scope without using any special declarations like immediately invoked functions.


Function declarations are scoped in the same way as var declarations (to the function).

If you want to scope something to a block, use const or let.

You can use a function expression or arrow function to provide a value to a const or let declaration.