Javascript String resume(limit, glue)

Description

Javascript String resume(limit, glue)


'use strict';//from  w  w w . j  a  v  a  2  s . c o m

String.prototype.resume = function(limit, glue) {
  var l = limit || 10;
  var g = glue || '...';

  return this.slice(0, l).trim() + g;
};

module.exports = String.resume;



PreviousNext

Related