Is there a way to make a custom conditional statement? Or is this not possible and I would have to just put the function inside of an if
.
For example:
customConditional(bar){
//run this code
}
Where if bar
was 1
it would execute the code and any other number wouldn't.
Edit: What I was trying to say was, how are conditionals defined and is there a way to define another one?
No need to do that, all you need is a method that will return a true/false statement then use it inside an if condition:
Example:
Usage: