Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function checkDigit(value) {
- value = value.toString();
- if (value.charAt(value.length - 3) === '3') {
- return true;
- }
- else {
- return false;
- }
- }
- console.log(checkDigit(1235));
- console.log(checkDigit(25368));
- console.log(checkDigit(123456));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement