DEV Community

Discussion on: JavaScript - Ternary Operator

Collapse
cesar_code profile image
César Author • Edited

I love it! Thank you!

The function being referred to in this course takes the explicit road. I wanted it to be beginner friendly. But, I usually do it this way:

const log = (x) => console.log(x);
Enter fullscreen mode Exit fullscreen mode

I think I found an alternative haha thanks!🙏

Collapse
oskarcodes profile image
Oskar Codes

Well it’s not exactly a perfect alternative, as your solution won’t accept multiple parameters, like this:

console.log("Hello", "World");
Enter fullscreen mode Exit fullscreen mode

But mine will.