7 kyu - Don’t give me Five!

Codewars is a fun way of learning coding/algorithms…”enlighten” if you will. Since I’m devoid of worthwhile blog-posts, I hope it may be helpful to offer insights I gather from tackling the many Katas (challenges) out there.

https://www.codewars.com/kata/dont-give-me-five/javascript

“In this kata you get the start number and the end number of a region and should return the count of all numbers except numbers with a 5 in it. The start and the end number are both inclusive!” Example:

1,9 -> 1,2,3,4,6,7,8,9 -> Result 8
4,17 -> 4,6,7,8,9,10,11,12,13,14,16,17 -> Result 12
My Solution

Some neat things (to me anyhow) from my solution are: how you can coerce a number into a string value by concatenating empty string to a number. Also the string-method ‘includes’ which determines whether a string contains a specified value…google is a powerful ally.

But solving a Kata is only part of the fun/learning-experience as the true enlightenment starts when you get to see other people’s solutions and try to understand what they’ve done… 0_o

Dafuq?!