how to handle destructuring values code example
Example 1: object destructuring into this
const demo = { nextUrl: 'nextUrl', posts: 'posts' };
const target = {}; // replace target with this
({ nextUrl: target.nextUrl, posts: target.communityPosts } = demo);
console.log(target);
Example 2: object destructuring default value
let a, b;
[a=5, b=7] = [1];
console.log(a); // 1
console.log(b); // 7