<script type="application/javascript;version=1.7">
function range(begin, end) {
for (let i = begin; i < end; ++i) {
yield i;
}
}
alert([i for each (i in range(0, 101)) if (i % 2 == 0)].reduce(function(sum, i) { return sum + i; }, 0));
</script>
Запускать в Firefox >= 3.5.