Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons
  • Teach on BraveProgrammer

© 2026 BraveProgrammer. All rights reserved.

Object Literals, Shorthand & Dest | JavaScript Course lesson | BraveProgrammer
  1. Courses
  2. /
  3. JavaScript Course

Lesson 20 of 55

·javascript

Object Literals, Shorthand & Destructuring

10 mins

Course progress36%

What you'll learn

Keep these ideas in mind as you work through the lesson.

3 points
  • Destructuring works with default values and **rest syntax** (`...rest`).
  • Property shorthand saves typing and improves readability.
  • Rest/spread can be used to **merge** objects (`{...obj1, ...obj2}`).

Object literal shorthand:

const name = 'John';
const user = { name, age:30, greet(){ console.log('hi'); } };

Destructuring makes extracting values easy:

const {name, age} = user;
const [first, second] = [10,20];

Nested destructuring:

const {address:{city}} = user;

Example: Function parameter destructuring

function render({title, content, author='Anonymous'} = {}){
  console.log(title, content, author);
}
render({title:'Demo', content:'Hello'});
Make it stickPractice what you've learned1 quiz · 7 practical tests · Optional activities from JavaScript CourseBrowse activities
Previous lessonArray Methods – map, filter, reduce, find, some, everyContinue to lesson 21Spread & Rest SyntaxBack to JavaScript Course curriculum