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

© 2026 BraveProgrammer. All rights reserved.

  1. Courses
  2. /
  3. JavaScript Course

Lesson 20 of 55 · javascript

Object Literals, Shorthand & Destructuring

Duration: 10 mins

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'});
Previous: Array Methods – map, filter, reduce, find, some, everyNext: Spread & Rest Syntax