Ad
  • Default User Avatar

    I can't answer your actual question but I can give oyu this info that I looked up on the performance of terrinary operators comapred to if statements. Terniary is better preformance wise than if statements. I think that is also a generall assumption we make when learning about terrinary operators. However I never actually understood the technical reason why. Here it is based off my google search: An if / else statement emphasises the branching first and what's to be done is secondary, while a ternary operator emphasises what's to be done over the selection of the values to do it with.