test if currentBook is undefined in JS
Fixed variable name typo