"use strict";/** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */varminBy=require("./minBy");varcompareNumber=functioncompareNumber(a,b){returna-b;};/** * Returns the maximum element as measured by a scoring function f. Returns the * first such element if there are ties. */functionmaxBy(as,f,compare){compare=compare||compareNumber;returnminBy(as,f,function(u,v){returncompare(v,u);});}module.exports=maxBy;