Ad
Code
Diff
  • const findMax=_=>Math.max(..._)
    
    • const findMax = (arr) => Math.max(...arr)
    • const findMax=_=>Math.max(..._)
Fundamentals
Strings
Data Types
Code
Diff
  • 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));
Strings
Data Types
Code
Diff
  • let lastChar = string => string.slice(-1)
    • let lastChar = string => string[string.length - 1]
    • let lastChar = string => string.slice(-1)