tutorial.eyehunts.com
Single line if statement JavaScript | Best One Line syntax - EyeHunts
One way is to use a ternary operator which works as a single line if statement in JavaScript. This is the best way, let's see the example
Rohit