This is the console. All output created with
writeLog()
is shown here.
Please type a number in each input field and press "Add". I will print the sum of both to the console.
This is the JavaScript code behind the above application.
/* global writeLog, getInput */ log("Solution for exercise 1.1 c)"); function add() { // Get the values from both input fields var numberA = getInput("theNumberA"); var numberB = getInput("theNumberB"); writeLog("I will perform this calculation: " + numberA + " + " + numberB); var sum = parseFloat(numberA) + parseFloat(numberB); writeLog("The result is: " + sum); }