<!doctype html>
<html>

<head lang="en">
  <title>Function part 1</title>
  <meta charset="utf-8">
</head>

<body>

</body>

</html>
function sum(a, b) {
  // this function returns a result
  return a + b;
}

function displayInPage(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));

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.