JSFiddle - React, Tailwind, and code Playground
JavaScript
let keyBoard = [['a','b','c'],
['d','e','f'],
['g','h','i'],
['j','k','l'],
['m','n','o'],
['p','q','r','s'],
['t','u','v'],
['w','x','y','z']]
let input = 2345;
let count = input.toString().length;
for(let i =0; i<=keyBoard.length; i++){
console.log(getDigit(input, count));
}
function getDigit(number, position) {
return (number/(10.0^position)) % 10;
};