Hi,
on the top of the page 4-34, you are calling a function computeNearestNeighbor('Angelica', 'Cagle', [1, 5, 2.5, 1, 1, 5, 1]), but if you assume to use the implementation of that function from page 4-33, it will cause an error.
I suggest to call the function like this computeNearestNeighbor('Cagle', [1, 5, 2.5, 1, 1, 5, 1], items) where items is vector represents all the attributes and the output is the same like in the book.
Cheers!
Jakub