0
let x = {
    a: 10,
    b: 20,
    c: 30
};

Is there any way to make only a,b keys of x as another object?

let y = x; //someway here through Object destructing

console.log(y); //{a:10,b:20}
Michał Perłakowski
  • 88,409
  • 26
  • 156
  • 177
Darshan Naik
  • 271
  • 1
  • 4
  • 15

0 Answers0