Just wanted to let everyone know that I checked in a couple of minor additions to exoweb.
reduceMDN documentation
Apply a function against an accumulator and each value of the array (from left-to-right) as to reduce it to a single value.This is a fairly new function, so its not available in IE8 and earlier. I added an fallback implementation to exoweb based on the example at the previous link.
Here's an example of what you might use it for:
>> arr
[0, 5, 3, 13.4]
>> arr.reduce(function(a, b) { return a + b; }, 0);
21.4
Or, more realistically, you probably have an entity list and need to map to property values first:
this.get_Items().map(function(item) {
return item.get_Value();
}).reduce(function(a, b) {
return a + b;
}, 0);
ifNullI added an option to the lazy markup extension to display static text if the path evaluates to null or undefined. This is something that you could accomplish with toggle or sys:if, so its mainly for convenience and readability.
<span>{~ Person.Name, ifNull=n/a }</span>