8.1 Syntax (script elements, JavaScript rules)

Based on your learnings in the past quarters, HTML was not initially supposed to control the display of web pages in a browser. Web pages were static when HTML was first created, which means they could not change or alter after being rendered by the browser. However, people started to understand that greater interactivity and improved graphic design would make the web more usable as the web expanded beyond a small academic and scientific community.

Read More

8.2 Variable Declarations and Data Types (primitive)

In this learning guide, we are going to focus on the “variable” which is one of the foremost fundamental units of JavaScript. The different ways in which a variable can be declared and assigned, as well as a few other common bits of information about variables can also be learned from this module.

Read More

8.3 Operations (Logical, Arithmetic, Comparison, Assignment)

Supposed, you are going to check whether a user input is greater than a default number. In order to do this, you should be able to compare the value of the user input and default number. The comparison of these two numbers will require you to use the JavaScript comparison operator.

Read More

8.4 Basic Statements (I/O Statements)

In the previous lesson, we use the document.write(); in order to output information on the browser. This is also one of the different ways to output results in JavaScript. In this lesson, you will be able to encounter the 4 input/output statements used in JavaScript. Each of them has its own purpose and can be used for specific reasons.

Read More

9.3 Processing Function Output

Functions allow programmers to create “blocks” of code that can be executed multiple times without having to write the lines of code as much as the number of times that it is called. To effectively make use of functions, the outputs from these blocks of code must be handled in such a way that they can be used with the rest of the main code.

Read More

9.4 Commonly Used JavaScript Objects: Math and String Methods

An object is a data type that acts like a variable but unlike the variables that we have learned so far, objects can contain multiple values. These multiple values correspond to the properties of the object. Objects can also have functions or actions that can be performed specifically for/on them. These functions are called methods. Methods can either be built-in or declared by the user.

Read More

9.5 Commonly Used JavaScript Objects: Date and Number Objects

In programming, numerical values are considered “primitive” because they have no intrinsic properties. Imagine an integer whose only value is the numerical value that it represents. They are unlike strings and arrays who have other values and aside from the values that they represent. An example is the length property that is built-in for both string and array data types and the toUpperCase() method built-in for the string data type. Numbers have no such properties built-in for them. Programmers have to create separate functions or declare them as objects in order to achieve this.

Read More

10.1 Control Statements

Recall that during your Grade 8 Computer Science, you can make use of special statements to direct the flow of your code. These special statements are called control statements. JavaScript has several control statements which are if-else[if], switch, and for loop.

Read More