I have a data structure like this :
const data = {
"CHI" : { fr: "chien", en: "dog"},
"CHA" : { fr: "chat", en: "cat"},
"POU" : { fr: "poule", en: "chicken"},
"OIS" : { fr: "oiseau", en: "bird"},
}
From wich I would like to create 2 objects like this :
// #1
const fr = {
"CHI" : "chien"},
"CHA" : "chat"},
"POU" : "poule"},
"OIS" : "oiseau"},
}
// #2
const en = {
"CHI" : "dog"},
"CHA" : "cat"},
"POU" : "chicken"},
"OIS" : "bird"},
}
Many thanks !