Question

Need help with this textbook problem Write a simple JavaScript function named makeFullName with two parameters...

Need help with this textbook problem

Write a simple JavaScript function named makeFullName with two parameters named givenName and familyName. The function should return a string that contains the family name, a comma, and the given name. For example, if the function were called like this:

var fn = makeFullName("Theodore", "Roosevelt");

it would return "Roosevelt, Theodore" without the double quotes.

Test Cases
Parameters Return
givenName familyName
"Theodore" "Roosevelt" "Roosevelt, Theodore"
"Barak" "Obama" "Obama, Barak"
"Donald" "Trump" "Trump, Donald"
0 0
Add a comment Improve this question Transcribed image text
Answer #1
Answer :
function makeFullName(givenName, familyName)
{
    return givenName+", "+familyName;
}
Add a comment
Know the answer?
Add Answer to:
Need help with this textbook problem Write a simple JavaScript function named makeFullName with two parameters...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • JavaScript: Write a function named "insertWord" that that doesn't take any parameters and doesn't return a...

    JavaScript: Write a function named "insertWord" that that doesn't take any parameters and doesn't return a value. This function should find an HTML element with an id of "content" and replace its innerHTML with the string "airplane"

  • Write a function named mostFrequent that takes two parameters: 1. inFile, a string that is the...

    Write a function named mostFrequent that takes two parameters: 1. inFile, a string that is the name of an input file 2. outFile, a string that is the name of an output file The input file inFile exists when mostFrequent is called; mostFrequent must create outFile. The input file contains only lower case letters and white space. The function mostFrequent identifies the letter(s) that appear most frequently on each line of inFile and writes them to a corresponding line of...

  • Write a function template named summarray, with two parameters: and array called are and an int...

    Write a function template named summarray, with two parameters: and array called are and an int holding the number of elements in arr. The function should return the sum of the elements in arr. this template must work for double or int arrays. Show a sample function call to the template function you wrote. What would you have to do to use the templates sumArray function with an array of objects of a custom class?   

  • Define a function named how_many_substr_of_string(...) which receives two parameters, the first parameters is a list with...

    Define a function named how_many_substr_of_string(...) which receives two parameters, the first parameters is a list with strings (name it  listst) and the second parameter is a single string (name it st). The function should return a number, indicating how many of the strings in the list listst are substrings in the string st As an example, the following code fragment: listst = ["a","bc","dd"] st = "abc" res = how_many_substr_of_string(listst,st) print (res) should produce the output: 2 language:Python

  • help ASAP 3. Write a string C++ function named UnsignedPartialSum() that takes two string parameters and...

    help ASAP 3. Write a string C++ function named UnsignedPartialSum() that takes two string parameters and an int parameter. If both string parameters represent binary numbers and the int parameter is equal to a positive number less than or equal to the length of the longest string parameter, the function should return a binary string whose length is equal to two times the length of the maximum length of the two string parameters whose value is equal to the sum...

  • Define a function named how_many_substr_of_string(...) which receives two parameters, the first parameters is a list with...

    Define a function named how_many_substr_of_string(...) which receives two parameters, the first parameters is a list with strings (name it  listst) and the second parameter is a single string (name it st). The function should return a number, indicating how many of the strings in the list listst are substrings in the string st As an example, the following code fragment: listst = ["a","bc","dd"] st = "abc" res = how_many_substr_of_string(listst,st) print (res) should produce the output: 2 Language Python

  • Hi, I need help with Javascript please. Question: Write a function named "tweets" that takes a...

    Hi, I need help with Javascript please. Question: Write a function named "tweets" that takes a string as a parameter and returns the number of tweets required to tweet the input to the world. Note: The maximum length for a single tweet is 280 characters. Thanks!

  • Write a function named words_in_both that takes two strings as parameters and returns a set of...

    Write a function named words_in_both that takes two strings as parameters and returns a set of the words contained in both strings. You can assume all characters are letters or spaces. Capitalization shouldn't matter: "to", "To", "tO", and "TO" should all count as the same word. The words in the set should be all lower-case. For example, if one string contains "To", and the other string contains "TO", then the set should contain "to". The file must be named: words_in_both.py...

  • /* Write a recursive function named editDistance that accepts two string    * parameters and returns...

    /* Write a recursive function named editDistance that accepts two string    * parameters and returns the "edit distance" between the two strings as an    * integer. Edit distance (also called Levenshtein distance) is the minimum    * number of "changes" required to get from s1 to s2 or vice versa. A "change"    * is a) inserting a character,    * b) deleting a character, or    * c) changing a character to a different character.    *...

  • Write a function named words_in_both that takes two strings as parameters and returns a set of...

    Write a function named words_in_both that takes two strings as parameters and returns a set of the words contained in both strings. You can assume all characters are letters or spaces. Capitalization shouldn't matter: "to", "To", "tO", and "TO" should all count as the same word. The words in the set should be all lower-case. For example, if one string contains "To", and the other string contains "TO", then the set should contain "to". You can use Python's split() funciton,...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT