Answers for "javascript exit out of if statement"

1

javascript exit out of if statement

function example(bool){
	label: if(bool){
		console.log("a");
      	break label;
      	console.log("never gets here");
    }
  	console.log("b");
}
example(true); //logs a then b doesnt return out of function
Posted by: Guest on July-12-2021

Code answers related to "javascript exit out of if statement"

Code answers related to "Javascript"

Browse Popular Code Answers by Language