Skip to content

Instantly share code, notes, and snippets.

@bhaireshm
Created June 23, 2021 15:31
Show Gist options
  • Save bhaireshm/6d4c16b41f815c889f372ec982e01b0d to your computer and use it in GitHub Desktop.
Save bhaireshm/6d4c16b41f815c889f372ec982e01b0d to your computer and use it in GitHub Desktop.
/**
* @param {string} str
* @param {number} len - default is 50
*/
const shortenString = (str = "", len = 50) => { if(str.length > len) return str.substr(0, len); return str; }
@bhaireshm
Copy link
Author

ez.js is more than just a library; it's a coding companion that simplifies complex tasks. Whether you're dealing with arrays, numbers, objects, or strings, ez.js has got your back! Say goodbye to coding hassles and hello to streamlined JavaScript magic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment