underscore
GitHub Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Keys

maps.Keys returns the keys of a map in unspecified order.

package main

import (
 "fmt"
 m "github.com/rjNemo/underscore/maps"
)

func main() {
 fmt.Println(m.Keys(map[int]string{1:"a",2:"b"})) // e.g., [2 1]
}