Overview

This is the code that we created together in class today. It is not an assignment, it is just a reference.

The JavaScript

We created a folder in the root of our repository called JavaScriptTest. Inside it we put a file called test.js. Here is test.js:

var prog109 = 'Prog109 on Monday';

var a = 10;
var b = 15;

console.log(prog109);
console.log('a + b =', a + b);
console.log(a * b);

Terms

Here are the variables from test.js

  • prog109: string
  • a: number
  • b: number

Here are the operators:

  • plus operator: +
  • multiplication operator: *
  • equals operator: =

Here are the methods we called:

  • console.log

Here are some of the parameters we passed to console.log:

  • prog109
  • ‘a + b =’, a + b
  • a * b

References

The HTML

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>JavaScript Test</title>
    <script src="test.js"></script>
</head>
<body>

</body>
</html>

Reference