how to destructure an object and insert in an another 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: javascript function destructuring
function f() {
return [1, 2];
}
let a, b;
[a, b] = f();
console.log(a); // 1
console.log(b); // 2