Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const numToDigits = (input = prompt("Введите число: ")) => {
- const t = parseInt(input, 10)
- if (t > 0 && t < 1000) {
- const [s, d, e] = input.toString().padStart(3, "0").split("")
- return {
- 100: +s,
- 10: +d,
- 1: +e
- }
- }
- console.error("Хуйню ввели Вы вместо числа нужного")
- return {}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement