Finding the smallest value in a Swift array of Integers

It's far from a groundbreaking invention, but there's something very satisfying about this way of finding the smallest value in a Swift array of Integers:

var minimum = someArray.reduce(Int.max, min)

Original post: https://kitsunesoftware.wordpress.com/2018/10/26/1410/

Original post timestamp: Fri, 26 Oct 2018 21:05:33 +0000

Tags: Coding, Programming, Swift

Categories: Professional, Software


© Ben Wheatley — Licence: Attribution-NonCommercial-NoDerivs 4.0 International