Skip to content

Instantly share code, notes, and snippets.

@ravinsinghd
Last active August 16, 2017 20:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ravinsinghd/6d3207ba51a07957872c060e11da4798 to your computer and use it in GitHub Desktop.
Save ravinsinghd/6d3207ba51a07957872c060e11da4798 to your computer and use it in GitHub Desktop.
let counterLimit;
function setCounterLimit(){
counterLimit=10;
}
function validateLimit(){
if(currentValue>counterLimit){
return false;
}
return true;
}
.
.
.
// 100 or 200 line after
function specialCaseValidate(){
// i am setting the couterlimit to 20 for validate the special customer
counterLimit=20;
if (validateLimit()){
// some logic
}
// resetting counter limit to old state
counterLimit=10;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment