Looks like you got most of the bits right, but you've got a typo and are using the scan function incorrectly in a few ways.
Functions in Javascript are caleld with parentheses, not brackets as you have them. Additionally, the scan() function takes a single item as a parameter, not an array (or multiple parameters).
So to scan one 'eggs', the code would look like this:
cashRegister.scan('eggs');
That should get you back on track.