daily pastebin goal
14%
SHARE
TWEET

Untitled

a guest May 23rd, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function excerpt(str, nwords) {
  2.   var words = str.split(' ');
  3.   words.splice(nwords, words.length-1);
  4.   return words.join(' ') +
  5.     (words.length !== str.split(' ').length ? '…' : '');
  6. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top