index.js
function generateString(set, length) {
    var content = '';

    // Cannot generate a string from an empty set
    if (set.length <= 0) {
      return content;
    }

    for (var i = 0; i < length; i++) {
      content += String.fromCharCode(
        set[Math.floor(Math.random() * set.length)]
      );
    }

    return content;
  }
function generateString(set, length) {
    var content = '';

    // Cannot generate a string from an empty set
    if (set.length <= 0) {
      return content;
    }

    for (var i = 0; i < length; i++) {
      content += String.fromCharCode(
        set[Math.floor(Math.random() * set.length)]
      );
    }

    return content;
  }
function generateString ( set , length ) { var content = '' ; // Cannot generate a string from an empty set if ( set . length <= 0 ) { return content ; } for ( var i = 0 ; i < length ; i ++ ) { content += String . fromCharCode ( set [ Math . floor ( Math . random ( ) * set . length ) ] ) ; } return content ; }
Generates a string of the given length from the given set of characters

@param {Array} set An Array of decimal characters
@param {Integer} length The length of the string to generate
@returns {String} The random generated string
Generates a string of the given length from the given set of characters