var name = "Alana" name.slice(1,4); // will give l, a, n // 4-1=3 so you will get 3 characters // 1 starts at the 2nd letter. 4 stops up to but not including the 5th letter alert(prompt("Compose your tweet:").slice(0,140)); // allows you to compose your tweet up to 140 characters and no more
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter