In this lab, we'll create objects and perform various operations on them.
Be sure to run the tests to get a feel for the types of problems this lab is
asking you to solve. In particular, you'll need to define a recipes
object and
then apply certain updates (destructively and non-destructively) in various
functions.
Good luck!
HINT: You might find deleteFromObjectByKey
to be a bit hard to write non-destructively. Think about how we learned to use Object.assign
. What happens if we do
var obj = { foo: 'bar' }
var newObj = Object.assign({}, obj)
newObj // { foo: 'bar' }
delete newObj.foo // true
newObj // {}
obj // { foo: 'bar' }
Hmmmmm...
View Javascript Objects Lab on Learn.co and start learning to code for free.