Update JavaScriptcode.js

Items seem to work, but I get [object object] for some reason. they also don't disappear when I take them. check functions for item prototype.