Skip to content

快速找出数组中的最大值 #8

@JesseZhao1990

Description

@JesseZhao1990

方法一

function getMaxOfArray(arr){
     return Math.max,apply(null, arr)
}

方法二

Math.max(...arr);

方法三
自定义一个函数,把数组里的每个数遍历一遍。

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions