Question: JavaScript 1. Write a function named f1 In the body of the function write code for the following. Declare a variable named v1 Assign a

JavaScript

1. Write a function named f1

  1. In the body of the function write code for the following.

    1. Declare a variable named v1

    2. Assign a value of the string literal Hello from function f1 to the variable v1.

    3. Call the alert function to display the value of v1.

  2. Outside of the body of the function named f1, write the code to call function f1.

------------------------------------------------------------------------------------------------------------------------------------

  1. Write a function name f2. The function will accept one parameter named p1.

  2. In the body of the, write an IF statement which evaluates the value of p1.

  3. If the value of p1 is greater than 10, display a popup alert message which is the value is greater than 10.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!