*I have a little issue on instructions: Built-in Object Methods.
Declare a const
variable named newRobot
. newRobot
will be a new object that has all the properties of robot
and the properties in the following object: {laserBlaster: true, voiceRecognition: true}
. Make sure that you are not changing the robot
object!
The way I understood the instruction the properties and values of robot will be assigned first to the new variable. The next step would be to use the Object.assign method insert the following values {laserBlaster: true, voiceRecognition: true}
and that’s what I did.
const robot = {
model: 'SAL-1000',
mobile: true,
sentient: false,
armor: 'Steel-plated',
energyLevel: 75
};
const newRobot = Object.entries(robot) ;
Object.assign(newRobot,{laserBlaster: true, voiceRecognition: true} );
I console it and their was no syntax error, I also check the MDN documents. But my understanding of the instruction is wrong!, what the instruction meant was that the {laserBlaster: true, voiceRecognition: true} is the target and robot object is the source.
const newRobot = Object.assign({laserBlaster: true, voiceRecognition: true}, robot);
I am not english speaker, can codecademy, make the sequence of the instruction more detail thanks