Guest User

Untitled

a guest
Feb 18th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. function unusedDigits(){
  2.  
  3. const args = [].slice.call(arguments).join('');
  4. const num = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
  5. const res = [];
  6.  
  7. for (let numIndex = 0; numIndex < num.length; numIndex++) {
  8. if(args.indexOf(num[numIndex]) > -1) {
  9. continue;
  10. }
  11.  
  12. res.push(num[numIndex]);
  13. }
  14. return res.join('');
  15. }
Add Comment
Please, Sign In to add comment