How to Truncate a String in JavaScript

How to Truncate a String in JavaScript