Truncate A String, freeCodeCamp Review Basic Algorithm Scripting lesson 9

Channel:
Subscribers:
8,020
Published on ● Video Link: https://www.youtube.com/watch?v=H4dgRPgykQY



Duration: 4:06
2,341 views
32


In this freeCodeCamp challenge we look at truncating a javascript string. Javascript strings can be truncated with the slice method. The slice method will allow us to extract a section of a string that we specify. The first argument it takes is where you want to start the extraction from. The second is where you want the extraction of the string to end and it will go up to but not include that position. In this challenge we use an if else if condition to solve the challenge.







Tags:
javascript length method
length in javascript
truncate string
truncate javascript string