I am practicing this https://developer.mozilla.org/en/Canvas_tutorial/Basic_animations Clock tutorial.
Everything in the code is clear to me.
Accept this hr = hr>=12 ? hr-12 : hr; is not clear me. May be it’s a if else statement.
Can any explain what this code is doing?
Thanks 🙂
This is the ternary operator
(?:)Here is the simple explanation of what is being done here: