I have a bit JSON object with over 50 keys like
const data = {a:1, b:2, c:3,....,y:99,z:100}
and 2 arrays containing keys of this json object
const arr1 = ["a", "b", "m", "l", "x", "y", "Z"]
const arr2 = ["c", "d", "g", "h", "i", "k", "q"]
Now I want to copy all the value from data
object into 2 new objects which contain only data of those keys which are present in arr1
and arr2
into 2 objects