Answer the question
In order to leave comments, you need to log in
What does it mean to mutate the original object?
According to the task, there is a function:
function foo(object: Indexed){
}
you need to mutate the resulting object, write values to it, and then return it from the function
Answer the question
In order to leave comments, you need to log in
Mutate == Modify, just change/remove existing object fields, add new ones, and return the object in return
function mutateObject(object) {
delete object.a;
return object;
}
const object = {a: 1};
const result = mutateObject(object);
console.log(result) // {}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question