Skip to content

Split an integer number into an array or iterable value of single-digit numbers

Notifications You must be signed in to change notification settings

sovpro/split-num

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Split Number

Split an integer number into an array or iterable value of single-digit numbers.

Build status for Node.js 4.x and newer

Split into an array

let split_num = splitNum (123)

Split into an iterable value

let split_iterable = splitNum.lazy (123)
for (let digit of split_iterable) {
  // ... do stuff with digit
}