Day 6 of 365 days of coding! How to Truncate a String in JavaScript
Challenge: Create a function that accepts a string and a number. The function must return the given string truncated to the maximum length (number that was passed in) followed by "...". If the string is shorter than the passed maximum length return the passed string.
here is the blog post for this solution: https://hellodevworld.com/365-days-of...
******************************************************
ℹ Help Links ℹ
.substr(): https://developer.mozilla.org/en-US/d...
template literals: https://developer.mozilla.org/en-US/d...
ternaries: https://developer.mozilla.org/en-US/d...
******************************************************
******************************************************
My Gear: https://kit.co/HelloDevWorld/my-gear
Blog: https://hellodevworld.com/
Facebook: / hellodevworld
Dev.to: https://dev.to/hellodevworldblog
******************************************************
DISCLAIMER: Links included in this description might be affiliate links. If you purchase a product or service with the links that I provide I may receive a small commission. There is no additional charge to you!
outro audio by: LiQWYD