-
Not this is possible, but in JS, can I (easily) create an object (A) with X props from object B? So I can transform { a, b, c } => { b, c }
-
Here's what I was trying to achive: babeljs.io/repl/#?babili=false&evaluate=true&lineWrap=true&presets=es2015%2Clatest%2Creact%2Cstage-0&experimental=false&loose=false&spec=false&code=const%20a%20%3D%20%7B%20z%3A%201%2C%20y%3A%202%2C%20x%3A%203%20%7D%3B%0A%0Aconst%20bOldSkool%20%3D%20%5B'z'%2C%20'y'%5D.reduce((acc%2C%20curr)%20%3D%3E%20%7B%0A%20%20acc%5Bcurr%5D%20%3D%20a%5Bcurr%5D%3B%0A%20%20return%20acc%3B%0A%7D%2C%20%7B%7D)%3B%0A%0Aconst%20b%20%3D%20'%2F%3F%3F%3F'%3B%0A%0Aconsole.log(bOldSkool)%0Aconsole.log(b)%0A and yes, I know there are libs that can do it. I was after *single* op.