const findMax=_=>Math.max(..._)
const findMax = (arr) => Math.max(...arr)- const findMax=_=>Math.max(..._)
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); }); });
- 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);
- });
- });
Fundamentals
Strings
Data Types
const toHours = i => Math.floor(i / 60); const setDigits = i => `0${i}`.slice(-2); const getTime = i => [toHours(i), i % 60]; const toTime = arr => `${arr[0]}:${setDigits(arr[1])}`; const minutes = i => toTime(getTime(i));
const toHours = ( i ) => Math.floor( i / 60 );- const toHours = i => Math.floor(i / 60);
const setDigits = ( i ) => i < 10 ? `0${i}` : i;- const setDigits = i => `0${i}`.slice(-2);
const getTime = ( i ) => [toHours(i), i % 60];- const getTime = i => [toHours(i), i % 60];
const toTime = ( arr ) => `${arr[0]}:${setDigits(arr[1])}`;- const toTime = arr => `${arr[0]}:${setDigits(arr[1])}`;
const minutes = ( i ) => toTime(getTime(i));- const minutes = i => toTime(getTime(i));