How can I make the program stop execution further if certain conditions got matched in if/else?

var cost = function () {

  if (x.value == "1") {
   ....
  } else if (x.value == ""){
     I want my program to stop the execution of any further code here if x.value = empty or null
  }
};

I tried to return false here.

  • New to programming