var sampleNumber = 123456789, lastDigit = sampleNumber % 10; console.log('The last digit of ', sampleNumber, ' is ', lastDigit);