Ad
Code
Diff
  • const ageSumDigits = (age1, age2, age3) => {
      return (age1+'').split('').map(n => parseInt(n)).reduce((n, m) => n + m) < age2 + age3;
    }
    • const ageSumDigits = (age1, age2, age3) => {
    • const sumOfDigits = num => [...`${num}`].reduce((sum,digit) => sum+Number(digit),0);
    • return sumOfDigits(age2)+sumOfDigits(age3) > sumOfDigits(age1);
    • return (age1+'').split('').map(n => parseInt(n)).reduce((n, m) => n + m) < age2 + age3;
    • }
Code
Diff
  • count=_=>_.match(/a/gi).length;
    • function count(string) {
    • }
    • count=_=>_.match(/a/gi).length;
Code
Diff
  • neg=_=>-_;
    • function neg(number) {
    • return -(number);
    • }
    • neg=_=>-_;
Code
Diff
  • ok = n => "ok";
    • let ok = function() {return "ok";}
    • ok = n => "ok";
Code
Diff
  • av = n => Math.abs(n);
    • function av(num) {
    • return Math.abs(num);
    • }
    • av = n => Math.abs(n);
Code
Diff
  • function getChange(allPrice,youMoney){
      return parseFloat((1-(allPrice/youMoney)).toFixed(4))*youMoney;
    }
    • function getChange(allPrice,youMoney){
    • return Math.round(youMoney*1000 - allPrice*1000)/1000;
    • return parseFloat((1-(allPrice/youMoney)).toFixed(4))*youMoney;
    • }