JSFiddle - React, Tailwind, and code Playground

by eget teteete

JavaScript

function addNumder(n){
  if(n>0 && n<=999)
  {
		let	chislo = {
    единици: n%10,
    десятки: (n % 100 - n % 10) / 10,
    сотни: Math.floor(n/100)
    };
    return chislo
  }
}
console.log(addNumber(444));