結果 : javascript foreach get previous value