The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

4 common ways to get a substring from a string in JavaScript

4 common ways to get a substring from a string in JavaScript

2:38
There are four common ways to get a substring from a string in JavaScript, `substring`, `substr`, `slice`, and `split` + `join`. In this lesson you'll learn what the API to each of these methods is and how they compare.
Watch this lesson now
Avatar
egghead.io

There are four common ways to get a substring from a string in JavaScript, substring, substr, slice, and split + join. In this lesson you'll learn what the API to each of these methods is and how they compare.

Avatar
press0

Great demo. JsBin auto-complete looks very useful. For example, function substring() parameters automatically popup as you type. How did you enable auto-complete in JsBin ?
Thanks

In reply to egghead.io
Avatar
Kent C.

I tweeted my answer :-) https://twitter.com/kentcdodds/status/681327223278702592

Protip, turn on Tern.js in JSBin settings for some helpful autocomplete and intellisense :-)

In reply to press0
HEY, QUICK QUESTION!
Joel's Head
Why are we asking?