Console log is giving me "undefined". I can't find a way to add object properties inside myBox object with "addBook" function. Maybe I'm just calling it wrong, but I think it should be correct way to do it.
function addBook (box, name, writer) {
box["# of Books"]++;
box["book" + box["# of Books"]] = {title: name, author: writer};
}
var myBox = {
height: 10,
width:50,
volume:400
};
addBook(myBox, "Javascript Ninja", "Ninja");
console.log(myBox.book1.title);