DEV Community

Discussion on: What's one of the ugliest piece of code you've written so far?

Collapse
 
weeb profile image
Patrik Kiss

That is ugly indeed. What were you even doing there?

Here, I corrected your code

int boolToInt(boolean bool){
     if(bool===true && bool!==false){
          return 1;
     else{
          return 0;
     }
}