Well, sorry for the really dumb question... But I´m struggling to understand the If shorthand.
I´m trying to make a clamp function, but most of the examples are written on shorthand form. Example that i found here on Stack Overflow.
function clamp(num, min, max) {
return num <= min ? min : num >= max ? max : num;
}
Okay, i now what is happening, but i don´t how is happening... Off course, I could just happilly copy and paste that... Nevertheless, that´s no use if i actually want to learn. Can somebody explain/deconstruct for me what is happening on the return statement?
Thanks and again, sorry for the dumb question.