Frankly, it would be much better to write this as
var x = /* whatever */, fx = 0, yy = 0;
if (x && yy = $.parseJSON(decodeURIComponent(x))) {
fx = yy.products.length;
}
which is immediately clear to the reader.
Another way to write it with idiomatic Javascript (still no ternary operator) would be
var x = /* whatever */, yy, fx;
yy = $.parseJSON(decodeURIComponent(x)) || 0;
fx = (yy && yy.products.length) || 0;
which you can also write in one line by combining the declarations of yy
and fx
with the assignments. That's one statement less than the ternary operator, so if you are "optimizing" for statement count why not do that instead?