I was wondering how this code would look like with the ternary operator
if (a) {
// pass
} else {
b();
}
We got no(thing) code to execute when a is true but in case a is false there is some code b() which is then executed.
So we write that:
a ? : b();
But I am not sure if that is correct when you let the code for true empty or if you have to replace it with something. Actually I never use the ternary operator but we were asked to do so.