A Pen by Artur Sedlukha on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func Reduce(arr, reduceFunc, acc interface{}) float64 { | |
arrValue := redirectValue(reflect.ValueOf(arr)) | |
if !IsIteratee(arrValue.Interface()) { | |
panic("First parameter must be an iteratee") | |
} | |
returnType := reflect.TypeOf(Reduce).Out(0) | |
isFunc := IsFunction(reduceFunc, 2, 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"parser": "@typescript-eslint/parser", | |
"parserOptions": { | |
"ecmaFeatures": { "jsx": true }, | |
"ecmaVersion": 2018, | |
"sourceType": "module" | |
}, | |
"extends": [ | |
"airbnb", | |
"prettier", |
OlderNewer