You are given a JSON object representing (a small part of) your record collection. Each album is identified by a unique id number and has several properties. Not all albums have complete information.
Write a function which takes an
id, a property (
prop), and a
For the given
value is non-blank (
value !== "") and
prop is not
"tracks" then update or set the
value for the
value is non-blank, push the
value onto the end of the
"tracks" is non-existent before you update it, create an empty array before pushing a track to it.
value is blank, delete that
Always return the entire collection object.
Don't forget to use
bracket notation when accessing object properties with variables.