JAVASCRIPT EXAMS SCRIPT 2026/2027 QUESTIONS AND
SOLUTIONS RATED A+
✔✔What are the 2 types of Numbers within Datatypes? - ✔✔Integer: Whole Number (-
1, 450)
Float:Decimal Point (0.1, 12.454)
✔✔What are Strings within Datatypes? - ✔✔A line of text: "frog", "a red truck"
✔✔What kind of value does Boolean take? - ✔✔True or False
✔✔What is an Array? - ✔✔Used to store multiple values in a single variable.
Real ["blue", "5", "123456"]
Refer to the whole array using its variable name
Arrays are indexed from 0
✔✔Objects - ✔✔Custom datatypes with properties and actions
✔✔Operators - ✔✔Used to assign values to variables and perform mathematical
operations on them
✔✔Math Based Operators - ✔✔
✔✔Comparison Operators - ✔✔
✔✔Example of comparison operators - ✔✔var num = "5"; var numString ="5",
==Interpreted Value
num ==numString (true)
===Interpreted value and data type
num===numString(false)
✔✔Conditionals - ✔✔Statements that allow for code to be executed against conditionals
IF, ELSE statements
✔✔Example of Conditional IF Statement - ✔✔if (This condition is true) {Do this thing}
var Country = "Australia";
var Hemisphere, var Language;
, if (country = "England") {
hemisphere = "northern";
language = "english";
}
✔✔Example of Conditional ELSE Statement - ✔✔Else statements allow us to make an
alternative statement if original condition is false
if (this condition is true){
...do this thing
}else{
...do this other thing
}
✔✔Loops - ✔✔Repetitive Conditional statements.
Used to perform a calculation a number of times, or to iterate over a set of variables.
✔✔Three main types of Loops - ✔✔For: Set Number of Iterations
While: Certain conditions are met
Do...While: Certain condition is met
✔✔For Loop Example - ✔✔Repeats until a specific condition becomes false
✔✔While Loop Example - ✔✔Iterate while the condition is true
while (condition) {
do this thing
}
✔✔Do While Loop - ✔✔Iterate while the condition is true
do {
... this thing
} while(condition);
✔✔Function - ✔✔Re-useable blocks of instructions that can be executed by name.
-Perform common tasks
-saves time, reduces error
function functionName (data) {
SOLUTIONS RATED A+
✔✔What are the 2 types of Numbers within Datatypes? - ✔✔Integer: Whole Number (-
1, 450)
Float:Decimal Point (0.1, 12.454)
✔✔What are Strings within Datatypes? - ✔✔A line of text: "frog", "a red truck"
✔✔What kind of value does Boolean take? - ✔✔True or False
✔✔What is an Array? - ✔✔Used to store multiple values in a single variable.
Real ["blue", "5", "123456"]
Refer to the whole array using its variable name
Arrays are indexed from 0
✔✔Objects - ✔✔Custom datatypes with properties and actions
✔✔Operators - ✔✔Used to assign values to variables and perform mathematical
operations on them
✔✔Math Based Operators - ✔✔
✔✔Comparison Operators - ✔✔
✔✔Example of comparison operators - ✔✔var num = "5"; var numString ="5",
==Interpreted Value
num ==numString (true)
===Interpreted value and data type
num===numString(false)
✔✔Conditionals - ✔✔Statements that allow for code to be executed against conditionals
IF, ELSE statements
✔✔Example of Conditional IF Statement - ✔✔if (This condition is true) {Do this thing}
var Country = "Australia";
var Hemisphere, var Language;
, if (country = "England") {
hemisphere = "northern";
language = "english";
}
✔✔Example of Conditional ELSE Statement - ✔✔Else statements allow us to make an
alternative statement if original condition is false
if (this condition is true){
...do this thing
}else{
...do this other thing
}
✔✔Loops - ✔✔Repetitive Conditional statements.
Used to perform a calculation a number of times, or to iterate over a set of variables.
✔✔Three main types of Loops - ✔✔For: Set Number of Iterations
While: Certain conditions are met
Do...While: Certain condition is met
✔✔For Loop Example - ✔✔Repeats until a specific condition becomes false
✔✔While Loop Example - ✔✔Iterate while the condition is true
while (condition) {
do this thing
}
✔✔Do While Loop - ✔✔Iterate while the condition is true
do {
... this thing
} while(condition);
✔✔Function - ✔✔Re-useable blocks of instructions that can be executed by name.
-Perform common tasks
-saves time, reduces error
function functionName (data) {