function in block (FiB)

a "function declaration" defined in a "block".

JSdeclarationfunctionfunction in block (FiB)

a function declaration defined in a block.

However, in most browser-based JS engines (including v8):

📗 You Don't Know JS

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

recommendations for function in block (FiB)

Last updated