Code the add operation

For the multi-valued reference property Book::authors, we need to code the operations addAuthor and removeAuthor. Both operations accept one parameter, which denotes an author either by ID reference (the author ID as integer or string) or by an object reference.

The code of addAuthor is as follows:

Get hands-on with 1200+ tech skills courses.