JavaScript, Code Quality.
passing the limit to the function each time we want to validate the value. (just ignore the currentValue variable as of now as it also global variable, will focus on limit variable only).looks good, but it makes another problem, now whenever we want to validate we need to pass the value to function