Slices a tweet after 140 characters

PHOTO EMBED

Fri Apr 21 2023 12:46:28 GMT+0000 (Coordinated Universal Time)

Saved by @AlanaBF #javascript

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
content_copyCOPY

Slice - take the upper bound - lower bound will tell you how many characters you get out Always starts at 0. 1st character starts at position and stops up to and not including the final bound ____.slice(x,y)