Make Your If Condition More Beautiful in JavaScript

Hello devs,

In this JavaScript tips tutorial, I will show you, how we can beauty our if condition or conditional statement in JavaScript. It is not a widely used coding pattern. But you can use this in your code. 

So you can take it as to improve your js skills with these tips. So let's take an example to see the code:

If we have to execute a function just if a condition is true, like below:



But we can use a short-circuit just like 👇

condition && toto()


Hope it can help you.


Facebook Github
A web enthusiastic, a self-motivated full-stack software engineer from Dhaka, Bangladesh with experience in developing applications using Laravel , React and Vue js