In one sense it serves to raise this question, but apart from that in this program, it serves no discernible purpose. As a closing statement of a function it defines a return value that may be examined by the caller.
Consider a default case added to the switch:
default: return false;
The caller could assign a success variable to hold the return value:
success = scan('eggs');
if (!success) console.log("Item not scanned");
As an example. We would need to craft our logic so this fit the flow and permitted for correction/re-entry of the scan argument. This may have been the intention when the author created this challenge, or it may be a hint that we can do more with the logic, owing that we are left with only a working model, not a full fledged program of which this would be just a part.
Since it is a challenge, we can find teaching moments all over the place that may not be covered to any great extent, thus far, but that should seed our ambition to find more answers and new ways to use what we've acquired in the this track.