index.js
function generate(length) {
    var len = length - 1;
    var ary = new Array(len);
    for (var i = 0; i < len; i++) {
      ary.push(Math.floor(Math.random() * 10));
    }
    var num = ary.join('');
    return num + '' + checkSum(num);
  }
function generate(length) {
    var len = length - 1;
    var ary = new Array(len);
    for (var i = 0; i < len; i++) {
      ary.push(Math.floor(Math.random() * 10));
    }
    var num = ary.join('');
    return num + '' + checkSum(num);
  }
function generate ( length ) { var len = length - 1 ; var ary = new Array ( len ) ; for ( var i = 0 ; i < len ; i ++ ) { ary . push ( Math . floor ( Math . random ( ) * 10 ) ) ; } var num = ary . join ( '' ) ; return num + '' + checkSum ( num ) ; }
create generate code

@param {number} length generage
@return {string} generaged digits value
create generate code