Finding the sum of all numeric palindromes that are less than N I wrote a function that finds the sum of all numeric palindromes lesser than N.


const sumOfPalindromes = (n) =&gt; {
    let x = 0;
    for (let i = 0; i &lt;= n; i++) {
      x += i == (''+i).split('').reverse().join('') ? i : 0;
    }
    return x;
}

console.log(sumOfPalindromes(10000));
console.log(sumOfPalindromes(24));



Are there shorter, more-concise alternatives to the above approach (preferably without using a for loop)?
This is not a proper review, but rather an extended comment.

Are there shorter, more-concise alternatives to the above approach

Yes. You should view it not as a programming problem, but as a recreational math exercise.
Consider a simplest case of N being an even power of 10, say 1000000. For a moment, allow leading zeroes. Now, each 6-digit palindromic number abccba corresponds to a 3-digit number abc, and in fact is 1000*abc + cba. Notice that if the sum of all 3-digit numbers is X, the sum of all 6-digit palindromic numbers is 1000*X + X = 1001*X. As for X, recall the formula for the sum of an arithmetic progression 0 + 1 + 2 + ... + 999.
To deal with leading zeroes you must subtract the sum of those palindromic numbers which do have leading zeroes. Yet again, they are in form abba0 = 1000*ab + 10*ba. Yet again, use the arithmetic progression formula to get the result.
No programming beyond a few arithmetic operations is required.
I don't want to spell out the complete solution. I hope this is enough to get you started with the arbitrary N.