Briefle
LearnGlossaryPricing

Briefle words · Code & architecture

Spread syntax

The JavaScript '...' operator that copies the contents of an object or array into a new one.

Say it to an AI

TypeScript addMedication(patient, med) for our React patient chart. Keep it immutable: return a new Patient using spread syntax with the medication appended and a fresh updatedAt, never mutate the input, since the old object sits on the undo stack.

How an expert would brief the stronger version of “Add a medication”.

See it

Try it as a puzzle →

A clinic's patient-chart web app adds a prescription to the patient on screen, with undo.

Study A · the stronger one
Study B · the weaker one

Why: A uses '...patient' and '...patient.medications' to build fresh copies before adding 'med'.

Related words

  • Single responsibility principle
  • Flag argument
  • Side effect
  • Parameter object
  • Long parameter list
  • Named arguments
  • Options object
  • Utils file

Room 3 · Functions & structure

Learn “Spread syntax” in a five-minute lesson

Start free
AI can build almost anything. The bottleneck is saying what you want.
WordsPricingTermsPrivacyRefundsContact
© 2026 Briefle