- Open
index.html
in your browser - Add your inputs
- Hit "submit"
- See the results on screen, or in the dev console
Run node index.js
with arguments, for example, node index.js 1,2,3,4,5 2
where the first argument 1,2,3,4,5
is the array, and the second argument 2
is the target segments.
Note, important you don't add spaces into the array.