Move History

Fork Selected
  • Code
    const findMax=_=>Math.max(..._)
    
    Test Cases
    const chai = require("chai");
    const assert = chai.assert;
    
    describe("Solution", function() {
      it("should test for something", function() {
        assert(findMax([1,2,3]), 3);
        assert(findMax([-1,-3,-20]), -1);
        assert(findMax([0,-2,33,5]), 33);
      });
    });
    
  • Code
    • const findMax = (arr) => Math.max(...arr)
    • const findMax=_=>Math.max(..._)
    Test Cases
    • const chai = require("chai");
    • const assert = chai.assert;
    • describe("Solution", function() {
    • it("should test for something", function() {
    • assert(findMax([1,2,3]), 3);
    • assert(findMax([-1,-3,-20]), -1);
    • assert(findMax([0,-2,33,5]), 33);
    • });
    • });