---
# System prepended metadata

title: Untitled

---

```
hash = {thing1: 1, thing2: 2}
initial = 0
hash.each.reduce(initial, func)
# 3

def func(accumulator, b)
    # b is (index, value)
    return a + b[1]
end 

thing = initial
hash.each do |index, value|
    thing + value
end
```

```
const thing = [1, 2, 3]
let initial = 0
thing.reduce(0, (accumulator, element) => {
    console.log(accumulator)
    return accumulator + element
})

# 0
# 1
# 3

```
