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
  • 80,501
  • 25
  • 149
  • 167
Darshan Naik
  • 213
  • 1
  • 3
  • 14

0 Answers0