Update application2.js

validating if the value is put equal to the upper or lower limit and if so returning the original value