app/assets/javascripts/examples.js
/**
  * Prepends each line of a string with the provided indentation string.
  *
  * @param {String} input
  * @param {String} indentation
  * @returns {String}
  */
Prepends each line of a string with the provided indentation string.
Prepends each line of a string with the provided indentation string .
function indentLines (input, indentation) {
   var lines = input.split('\n');
   lines = lines.map(function (line) {
     return indentation + line;
   });
   return lines.join('\n');
 }
function indentLines ( input , indentation ) { var lines = input . split ( '\n' ) ; lines = lines . map ( function ( line ) { return indentation + line ; } ) ; return lines . join ( '\n' ) ; }
Prepends each line of a string with the provided indentation string.
Prepends each line of a string with the provided indentation string .