var tweet = prompt(“Compose your tweet:”);
var tweetUnder140 = tweet.slice(0.140);
alert(tweetUnder140);
I’m trying to push this code and i get the same error and i don’t know why .
var tweet = prompt(“Compose your tweet:”);
var tweetUnder140 = tweet.slice(0.140);
alert(tweetUnder140);
I’m trying to push this code and i get the same error and i don’t know why .
The syntax for slice() uses a comma to separate start and end indexes, not a dot.
where are you running this code? alert works if you are creating an html page, not if it’s a JS only enviroment