Essential all major modern languages have collection sorting functions built into the base collection types that accept “by” (or similar) arguments... which is quite intuitive to even Jr. programmers.
func lambdaHandler(event: Event, context: Context) { // your lambda handler logic... }
What’s wrong with this approach, which is how lambda handlers are written in every other language with the exception of JavaScript - let’s not pretend that JavaScript is a good language design reference.
Look at this Go example In comparison... simple, readable, intuitive:
package main
import ( "fmt" "context" "github.com/aws/aws-lambda-go/lambda" )
type MyEvent struct { Name string `json:"name"` }
func HandleRequest(ctx context.Context, name MyEvent) (string, error) { return fmt.Sprintf("Hello %s!", name.Name ), nil }
func main() { lambda.Start(HandleRequest) }