0
I would like to loop an object in order to capture the key and the corresponding value.
For example:
const obj = {
'Chave 1': 'Valor 1',
'Chave 2': 'Valor 2',
'Chave N': 'Valor N'
};
I’d like to return something like this:
Chave 1 => Valor 1
Chave 2 => Valor 2
Chave N => Valor N
Actually I want to return the key too. Your answer only causes the value corresponding to the key
Name
is returned. I want to return the value and key.– Luiz Felipe
@lffg I had understood otherwise, I made the correction, I hope, if that’s what you need.
– Marcos Souza
Thank you, that’s right.
– Luiz Felipe