Skip to content

Tag: syntax

Why do results vary based on curly brace placement?

Why do the code snippets below, taken from this article, produce different results due to only a single change in the placement of curly braces? When the opening curly brace { is on a new line, test() returns undefined, and “no – it broke: undefined” is displayed in the alert. When the brace…