Reference no: EM13935520
Can you please see below and review attachment. (adding parameters to functions & using function parameters)
You made some modifications to your program, but you did not change the function to accept a parameter. You can either modify the function in your program to accept a parameter, or you can use the function I demonstrate below in your program by adding it to your source code file.
To demonstrate I'm going to create a function that meets those requirements described below.
I'm going to name the function display_alert, because that is what the function does.
I'm going to name the parameter, message, because that's what the data contains.
The function is defined as follows:
function display_alert(message){
window.alert(message);
}
It looks very similar to the function you defined below, except for the fact that it gets the data to be displayed in the alert message, from the input parameter.
It uses the parameter variable as an argument to pass to the window.alert() function.
Your program should call this function 13 times.
Each time the function is called, the parameter variable will have a different value.
Two examples of calling the above function with an argument:
var mess1 = "Ten";
display_alert("Ten"); // call the function with an string literal argument
display_alert(mess1); // call the function with a variable argument
// A variable must be declared before(above) using it.
In both examples the value passed to the function is the string "Ten".
Notice that the name of the variable used in the argument does not have to be the same as the name of the parameter variable in the function definition.
Attachment:- Assignment2.zip
Strategic human resource management practices
: Engaging and motivating employees is at the centre of Strategic Human Resource Management (SHRM) practices. It is therefore important to identify the organisational practices that can be used to foster the cognitive, emotional and behavioural qual..
|
Calculate the expected value of projects net present value
: Calculate the expected value of the project's net present value (NPV) and determine the probability that the project will have a negative NPV.
|
Explain code of dna
: Briefly describe the debate between the theory of spontaneous generation and the theory of biogenesis. Explain how Louis Pasteur's experiment with the S-neck flasks in the 1800s resolved this debate. Include a detailed description of Pasteur's exp..
|
How country risk affects npv
: How country risk affects NPV. Explain how the capital budgeting analysis in the previous question would need to be adjusted if there were three possible outcomes for the dollar along with the possible outcomes.
|
Evaluate the function
: Can you please see below and review attachment. (adding parameters to functions & using function parameters)
|
Explain why the jc penney stores in mexico
: Explain why the JC Penney stores in Mexico and in other foreign markets are subject to financial risk (a subset of country risk).
|
How well integrated are hrm processes
: How well integrated are HRM processes with the organisation's strategic business directions? Specify the areas where the linkages do/do not occur, how one link might support or constrain another, and the implications of these relationships.
|
How is surveillance of the tissues carried out
: Contrast active and passive immunity in terms of how each is acquired, how long it lasts, whether memory is triggered, how soon it becomes effective, and what immune cells and substances are involved.
|
Benefits and purpose for an organizational vision statement
: Describe the core values of the organization. Why are these specific values important to the organization? Describe the benefits and purpose for an organizational vision statement. Develop a vision statement for this organization. When developing a ..
|