assign destructured object to anotehr variable code example
Example 1: how to use object destructuring to spread part of an object into another
how to use object destructuring to spread part of an object into another
Example 2: 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);