reduce a step in js 001
change use of reduce to inject in ruby 001