String | JavaScript Tutorial
Write a function truncate(str, maxlength) that check string str length. If the length of str is more than maxlength chars, it cuts str and appends it with '...' to make the length equal to maxlength. The returned value is a (possibly) corrected string For...