josdejong/mathjs — pull request #144 by mtraynham (2014-03-12 00:15:31+00:00)
Title: Adds the ifElse function.

This is a utility function for computing ternary operations. Granted, the same could have been achieved by adding parsing support for '?' & ':' reserved delimiters.

```
var result = ifElse(conditionalExpr, trueExpr, falseExpr);

returns conditionalExpr ? trueExpr : falseExpr;
```

Very simple. Only throws missing/excessive argument exception. Added lots of tests.

Relevant to Bug #116, could be a fix for it as well.