# Fun One Liners

**URL:** <https://discourse.julialang.org/t/fun-one-liners/28352>\
**Category:** General Usage\
**Created:** [September 3, 2019, 11:13pm UTC](https://discourse.julialang.org/t/fun-one-liners/28352 "2019-09-03T23:13:18Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![MrUrq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mrurq/32/8924_2.png) [@MrUrq](https://discourse.julialang.org/u/MrUrq)\
**Post date:** [September 4, 2019, 2:23pm UTC](https://discourse.julialang.org/t/fun-one-liners/28352/12 "2019-09-04T14:23:32Z")

</div>

@stevengj posted a nice one liner in [How to use minimum and maximum for a Vector{SVector{3}}](https://discourse.julialang.org/t/how-to-use-minimum-and-maximum-for-a-vector-svector-3/26235). The idea is to find the smallest component of the first, second, third … element in a vector of vectors.

```julia
A = [rand(3) for i = 1:10]
reduce((x,y) -> min.(x,y), A)

```

It is fast and works for other types to

```julia
A = [Tuple(rand(3)) for i = 1:10]
reduce((x,y) -> min.(x,y), A)

```

```julia
using StaticArrays
A = [SVector{3}(rand(3)) for i = 1:10]
reduce((x,y) -> min.(x,y), A)

```

---

_[View the full topic](https://discourse.julialang.org/t/fun-one-liners/28352)._
