Advertisement
ndburrus

word blanks @jeffersonnnn

Sep 2nd, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. // @jeffersonnnn
  2. // word blanks
  3.  
  4. function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
  5. var result = "";
  6. // Your code below this line
  7. result += "hoping " + "to " + "find " +"his " + "dog " + "in " +"the " + "big " + "city, "+ "he "+ "ran " + "quickly.";
  8.  
  9. <-- ok, this code produces: => 'hoping to find his dog in the big city, he ran quickly.'
  10. this would not be a complete sentence.
  11. we need to add capitalization.
  12. Hoping to find his dog in the big city, he ran quickly.
  13. ok, so next, we need to use the variables given, here: (myNoun, myAdjective, myVerb, myAdverb) - these are function inputs!
  14. we're working with the instructions, here:
  15. `You will need to use string operators to build a new string, result, using the provided variables: myNoun, myAdjective, myVerb, and myAdverb.`
  16. these may be helpful:
  17. * [Strings, String methods and properties](http://www.quirksmode.org/js/strings.html)
  18. * [Multiple ways to concatenate a String in Javascript](https://sraji.wordpress.com/2011/01/10/multiple-ways-to-concatenate-a-string-in-javascript/)
  19. alright, so when we use variables, they appear in the code as given (myNoun, myAdjective, etc).
  20. when we use "filler" words, we are adding them as strings (using quotes) - like this:
  21. "Hoping to find his ". notice how we need to account for spacing between the words/strings & variables!
  22. so, now we have all the information we need to complete the lesson :)
  23.  
  24. any questions?
  25.  
  26. you got this!
  27.  
  28. // Your code above this line
  29. return result;
  30. }
  31.  
  32. // Change the words here to test your function
  33. wordBlanks("dog", "big", "ran", "quickly");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement