Skip to content

coderdojo-renfrewshire/hashtag-challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trump Needs Your Help !

Mr Donald J Trump, needs your help because he doesn't know how many hashtags are in his awesome tweets!

alt tag

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

Loop Statement

for(var i = 0; i < 5; i++) {
	alert(i)
}

If Statement

if(5 > 0) {
	alert('5 is bigger than 0')
}

+ Operator

var tags = 0
tags = tags + 1
// tags now equals 1

Links