Q:

Ternary Statements in Javascript: pitfalls of no assignment?

Sometimes I use ternary statements to simplify & reduce the length of my code.  
Ternary statements are traditionally used to assign a value to a variable, but in JS I can also write ternary statements with no assignment to execute differing outcomes based on the boolean response to the question - example: 
anyVariable > someValue ? 
    funcOne(anyVariable): 
    funcTwo(anyVariable);

This code throws no errors, but jsLint complains that it saw an expression where it expected an assignment or function call.  
Are there any pitfalls or potential issues I should be aware of when using ternary statements (in Javascript) in this fashion?

A:

There should not be any pitfalls in this fashion. Consider the following statement - 
b = a = 10;

we can omit the "b=" portion of the statement without any issues. And its the same case for the ternary statements.
Generally you should avoid this type of use because an error in previous lines may cause problem with the later code. But if you use if-else then you can avoid such problems.
// user made a typo on the first line. but this code has correct syntax 
b = 10 +
a > 10 ? fun(20) : fun(0);

// same scenario using if-else will generate a compilation error which is preferred.
b = 10 +
if (a>10) {
    fun(20);
}
else {
    fun(0);
}

