Update HereshkoJohn_assignment2.js

Added function workability