Normal ternaries vs nested ternaries

This pretty much sums up my opinion about ternaries:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var Ternary = function(isNested) {
return {
is: function() {
return (isNested) ? 'the devil' : 'awesome';
}
};
};
// something like `size = (a < 10) ? 'small' : 'large'`
var aNormalTernary = new Ternary(false);
// think `size = (a < 10) ? (a < 5) ? (a < 0) ? 'negative'
// : 'tiny' : 'small' : 'large'`
var aNestedTernary = new Ternary(true);
aNormalTernary.is(); // awesome
aNestedTernary.is(); // the devil