Answer the question
In order to leave comments, you need to log in
How to replace a value in an object by key?
Hello, I'm learning js and I have such a task.
I need to iterate over two objects and if they have the same keys, then I need to replace their value. Can you suggest how to do it?
Here is the first object:
a = {
name: 'Alex',
lastName: 'Ivanov',
age: 20,
email: '[email protected]',
city: 'Moscow'
};
b = {
name: 'Ivan,
lastName: 'Volkov',
age: 18,
email: '[email protected]',
city: 'Moscow'
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question