Skip to content

Glossary: JavaScript Basics

Bracket notation

Also written: square brackets

Reading a property by putting its key as a string or variable in square brackets, like `mug["priceCents"]` or `rates[carrier]`. It's needed when the key is in a variable or isn't a valid name.

Where the book teaches it