Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // @jeffersonnnn
- // word blanks
- function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
- var result = "";
- // Your code below this line
- result += "hoping " + "to " + "find " +"his " + "dog " + "in " +"the " + "big " + "city, "+ "he "+ "ran " + "quickly.";
- <-- ok, this code produces: => 'hoping to find his dog in the big city, he ran quickly.'
- this would not be a complete sentence.
- we need to add capitalization.
- Hoping to find his dog in the big city, he ran quickly.
- ok, so next, we need to use the variables given, here: (myNoun, myAdjective, myVerb, myAdverb) - these are function inputs!
- we're working with the instructions, here:
- `You will need to use string operators to build a new string, result, using the provided variables: myNoun, myAdjective, myVerb, and myAdverb.`
- these may be helpful:
- * [Strings, String methods and properties](http://www.quirksmode.org/js/strings.html)
- * [Multiple ways to concatenate a String in Javascript](https://sraji.wordpress.com/2011/01/10/multiple-ways-to-concatenate-a-string-in-javascript/)
- alright, so when we use variables, they appear in the code as given (myNoun, myAdjective, etc).
- when we use "filler" words, we are adding them as strings (using quotes) - like this:
- "Hoping to find his ". notice how we need to account for spacing between the words/strings & variables!
- so, now we have all the information we need to complete the lesson :)
- any questions?
- you got this!
- // Your code above this line
- return result;
- }
- // Change the words here to test your function
- wordBlanks("dog", "big", "ran", "quickly");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement