-
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); }); });
Output:
-
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);
- });
- });
- All
- {{group.name}} ({{group.count}})
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}