Mr Donald J Trump, needs your help because he doesn't know how many hashtags are in his awesome tweets!
var tweet = 'Make Scotland great again! #notmyhair #russianfanboy';
var tags = 0;
// Add Your Code Here
alert(tags);
You will need to set the variable TAGS to be equal to the number of hashtags in his tweets. You will need to use the following features.
- For Loops
- If Statements
- The + operator
for(var i = 0; i < 5; i++) {
alert(i)
}
if(5 > 0) {
alert('5 is bigger than 0')
}
var tags = 0
tags = tags + 1
// tags now equals 1
- FakeTrumpTweet -> Website for generating your tweets
- Loop Tutorial -> For Loop Example
- IF Tutorial -> If Statement Example