❗function in block (FiB)
a "function declaration" defined in a "block".
JS ⟩ declaration ⟩ function ⟩ function in block (FiB)
a function declaration defined in a block.
sloppy mode: hoisted / initialized to undefined (outside block)
strict mode: local to the block.
However, in most browser-based JS engines (including v8):
the identifier of the FiB is scoped outside the block
function (declaration) in block
in sloppy mode:
can be considered as a redeclaration
if there's already a function with the same name in the outer scope
in strict mode:
recommendations for function in block (FiB)
Last updated