Dave Ngatia

    The find_max() function looks for the largest number in a set of numbers. If the number is larger than the maximum number the function finds, then that number is used.

    function find_max(nums) {
      let max_num = Number.NEGATIVE_INFINITY;
      for (let num of nums) {
        if (num > max_num) {
      return max_num;
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.