Javascript reduction.