Question
JavaScript .
there’s something wrong with this function
Correct it
Run Reset Code 1 function Add(A, B) 3 var C# A+B; 4 5 return C;
0 0
Add a comment Improve this question Transcribed image text
Answer #1
function Add(A, B)
{
    var C = A+B;
    return C;
}

Add a comment
Know the answer?
Add Answer to:
JavaScript . there’s something wrong with this function Correct it Run Reset Code 1 function Add(A,...
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 30. What will be displayed after the following code is entered and run if the...

    JavaScript 30. What will be displayed after the following code is entered and run if the user enters "9 am" at the first prompt and "N-215" at the second prompt? If you think there is an error, describe how you would fix it. function examTime() { var time = prompt("What time is the exam?"); var room = prompt("What room is the exam in?"); showIt(time, room); } function showIt(a, b) { document.write("Your exam is in room " + a + "...

  • Add JavaScript code in the “find_primeV2.js” to allow users to enter a number, and then based...

    Add JavaScript code in the “find_primeV2.js” to allow users to enter a number, and then based on the number of user enters, to find out how many prime numbers there are up to and including the user inputted number and then display them on the web page. The following are the detailed steps to complete this assignment: Step 1. [30 points] In “find_primeV2.js”, complete isPrime() function by (1) Adding one parameter in function header. That parameter is used to accept...

  • List the five implementation models of parameter passing. Consider the following closure in JavaScript: 1- function...

    List the five implementation models of parameter passing. Consider the following closure in JavaScript: 1- function makeAdder(x) { 2- return function(y) {return x + y;} 3- } . . . 4- var add1 = makeAdder(0); 5- var add2 = makeAdder(10); 6- document.write(add1(20)); 7- document.write(add2(20)); Questions: a) Show the output. b) What is the closure subprogram in this example? c) Explain how the variable x referenced at line 2 is bound.

  • This is my code so far: <!DOCTYPE html> <html> <head> <title>JavaScript is fun</title> <meta charset="utf-8" />...

    This is my code so far: <!DOCTYPE html> <html> <head> <title>JavaScript is fun</title> <meta charset="utf-8" /> </head> <body> <script type ="text/javascript"> //declare a variable and store text in it var x = "JavaScript is fun"; //write the variable 5 times document.write(x + x + x + x + x); //store 5 as string in variable x x = "5"; //store 3 as string in variable y var y = "3"; //write the value x + y to the document document.write("<br>");...

  • Please help me with the following requirements for JavaScript. Write a function to take a temperature value in Celsius a...

    Please help me with the following requirements for JavaScript. Write a function to take a temperature value in Celsius as an argument and return the equivalent temperature in Fahrenheit, basing it on the code from Hour 2. //Original Code <!DOCTYPE html> <html> <head>     <title>Fahrenheit From Celsius</title> </head> <body>     <script>         var cTemp = 100;  // temperature in Celsius         var hTemp = ((cTemp * 9) /5 ) + 32;         document.write("Temperature in Celsius: " + cTemp + " degrees<br/>");         document.write("Temperature in Fahrenheit: "...

  • Notepad++ JavaScript Create an HTML file, using XHTML. Add JavaScript scripts to the file. Create 3...

    Notepad++ JavaScript Create an HTML file, using XHTML. Add JavaScript scripts to the file. Create 3 variables to hold the famous quote (NOTHING BUT THE QUOTE). My code so far. var firstQuote = "Give me a museum and I'll fill it." // I am stuck on the document.write part. How can i display it? document.write("1. Pablo Picasso says: "+firstQuote");

  • only in javascript 1.Define a method named roleOf that takes the name of an actor as...

    only in javascript 1.Define a method named roleOf that takes the name of an actor as an argument and returns that actor's role. Ex: roleOf("Keira Knightley") returns "Elizabeth Swann". Hint: A method may access the object's properties using the keyword this. Ex: this.cast accesses the object's cast property. var movie = { // Code will be tested with different actors and movies name: "Pirates of the Caribbean: At World's End", director: "Gore Verbinski", composer: "Hans Zimmer", cast: { "Johnny Depp":...

  • JAVASCRIPT FUNCTIONS Write the isPrime function and the applySipping Cost function. Then, complete the code as...

    JAVASCRIPT FUNCTIONS Write the isPrime function and the applySipping Cost function. Then, complete the code as indicated at the end in comments var cart=1 {"name":"Biscuits", "type":"regular", "category":"food", "price": 2.0}, {"name":"Monitor", "type":"prime", "category":"tech", "price": 120}, {"name":"Mouse", "type":"prime", "category":"tech", "price": 25}, {"name":"dress", "type":"regular", "category":"clothes", "price": 50}, {"name":"XL Monitor","type":"prime", "category":"tech", "price": 160}, {"name":"Cookies","type":"regular", "category":"food", "price:16). function isPrime(item) { //WRITE THIS FUNCTION // should return true if the item's type is "prime" and false otherwise let iskotPrime = item => 'isPrime(item); let applyCoupon =...

  • The following JavaScript code will place the result of a multiplication in the result text box....

    The following JavaScript code will place the result of a multiplication in the result text box. var a=3, b=4; <input type = "text" id ="box1" onchange = 'a'b'> <input type="text" id ="result" onchange = True False

  • JavaScript Question Which of the following 4 options is the correct answer for this question ?...

    JavaScript Question Which of the following 4 options is the correct answer for this question ? The following program has a problem. What is it? var a; var b = (a = 3) ? true : false The condition in the ternary is using the assignment operator. You can't define a variable without initializing it. The code is using the deprecated var keyword. You can't use a ternary in the right-hand side of an assignment operator.

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