Question: Add a function called add ( a , b ) . Return the sum of a and b . Add a function called subtract (
Add a function called adda b Return the sum of a and b
Add a function called subtracta b Return ab
Add a function called sum with no parameters. Use the arguments and return a sum of all of the values passed to the function regardless of the number of arguments.
Add a function called setTitle that outputs the "Hello, this is Lab to the h element with id"title".
Add a function called studentNamename that outputs your full name to the div element with id"student".
Add a variable to the page called secondsSinceLoad and give it a starting value of Add an arrow function no curly brackets, no parenthesis, no function keyword called updateSeconds In the function, add to the value of secondsSinceLoad Display the current value of secondsSinceLoad in the HTML div provided with id"seconds". The display must happen from in the function.
Call setTitle when the page loads. I have provided a page load event below. Put all of the functions that should be called when the page loads into that single function.
Call and output the results from add; using document.writeln at the end of the body element.
Call and output the results from subtract; using document.writeln at the end of the body element.
Call and output the results from sum; using document.writeln at the end of the body element.
When the page loads, use setInterval to call updateSeconds every second.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
