if else vs if continue

Edit on GitHub

Difference between Conditions inside a loop using else vs continue

Setup

var i;
var dummy = 0;

Tests

  • if else

    for(i = 0; i < 10000; i++){
    	if( 0 == false ){
    
    	}else{
    		dummy++;
    	}
    }
  • if continue

    for(i = 0; i < 10000; i++){
    	if( 0 == false ){
    		continue;
    	}
    	
    	dummy++;
    }