const animalSounds = {cat: 'meow', dog: 'bark'}; const animal = 'lion'; const sound = 'roar'; {...animalSounds, [animal]: sound};