<!doctype html>
<html>
<head lang="en">
<title>Function part 2</title>
<meta charset="utf-8">
</head>
<body>
</body>
</html>
var sum = function (a, b) {
return a + b;
};
var displayInPage = function (message, value) {
// this function does not return anything
document.body.innerHTML += message + value + "<br>";
};
var result = sum(3, 4);
displayInPage("Result: ", result);
// we could have written this
displayInPage("Result: ", sum(10, 15));
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.