https://devhubby.com/thread/how-to-pass-anonymous-functions-as-parameters-in