Guest User

Untitled

a guest
Feb 17th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. // Given a non-negative integer, 3 for example, return a string with a murmur: "1 sheep...2 sheep...3 sheep...". Input will always be valid, i.e. no negative integers.
  2.  
  3. var countSheep = function (num){
  4.  
  5. count= "";
  6. for(var i = 1; i <= num; i++){
  7. count += i + " sheep, ";
  8. }
  9. return count;
  10. }
  11.  
  12. countSheep(8);
  13.  
  14. //do loop starting with one and count to max of input number
Add Comment
Please, Sign In to add comment