Consistent whitespace

This commit is contained in:
Isabelle Viktoria Maciohsek
2020-11-03 21:46:13 +02:00
parent f057d4d95b
commit 81e37d20c0
11 changed files with 16 additions and 13 deletions

View File

@ -6,7 +6,7 @@ tags: math,advanced
Implementation of the [Luhn Algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) used to validate a variety of identification numbers, such as credit card numbers, IMEI numbers, National Provider Identifier numbers etc.
- Use `String.prototype.split('')`, `Array.prototype.reverse()` and `Array.prototype.map()` in combination with `parseInt()` to obtain an array of digits.
- Use `Array.prototype.splice(0,1)` to obtain the last digit.
- Use `Array.prototype.splice(0, 1)` to obtain the last digit.
- Use `Array.prototype.reduce()` to implement the Luhn Algorithm.
- Return `true` if `sum` is divisible by `10`, `false` otherwise.