> For the complete documentation index, see [llms.txt](https://trizen.gitbook.io/sidef-lang/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trizen.gitbook.io/sidef-lang/programming_tasks/s/sum_and_product_of_an_array.md).

# Sum and product of an array

Using built-in methods:

```ruby
var ary = [1, 2, 3, 4, 5]
say ary.sum                  # => 15
say ary.prod                 # => 120
```

Alternatively, using hyper-operators:

```ruby
var ary = [1, 2, 3, 4, 5]
say ary«+»                   # => 15
say ary«*»                   # => 120
```
