use { ... } to group statements.
Last updated 2 years ago
Was this helpful?
JS ⟩ statement ⟩ other ⟩ block
(statement) use { ... } to group statements.
{ ... }
not block:
object literal / class / switch: no block scope❗
:its is different from a ❗
📗
/
won't operate across an to control an outer / block.
if the code you need to wrap a around has / / / in it:
don't use
A "" is just a of the (associated with the currently executing / / /script).
block scope
ℹ️braces {} punctuator is used in block.
Statements and declarations ⟩ Others ⟩ block
use block instead.
📗 You Don't Know JS Yet: Scopes & Closrues