DEV Community

Discussion on: Important JavaScript Shorthands to know 🚀🔥

Collapse
 
kilsonjs profile image
Kilson

I tried this way and it worked too

const x = 30;
if (x > 10) {
console.log("greater than 10");
} else {
console.log("less than 10");
}

Thread Thread
 
arjuncodess profile image
Arjun Vijay Prakash

Yeah. But I assigned the value to the variable that's why I mentioned that ways. Although that is also correct. Thanks for connecting with me. It was a great pleasure.

Thread Thread
 
kilsonjs profile image
Kilson

Alright