4 ms·
Have you ever used Array#map in Javascript (or any dynamic language)? What about filter or reduce? Those are useful things not possible in Go. Well, technicall
by notduncansmith 12y ago
Have you ever used Array#map in Javascript (or any dynamic language)? What about filter or reduce? Those are useful things not possible in Go.
Well, technically they are (whipped up a quick example): http://play.golang.org/p/e2qkKN4VY1 http://play.golang.org/p/e2qkKN4VY1
But it requires the use of interface{}, which reduces the usefulness of the type system, and you still can't do (what I guess must be crazy) stuff like return a slice.