NEW
Font size
WorksheetsPhase 1 Recap
Total questions: 13
Worksheet time: 5mins
Who is the CEO of Moringa School?
What is a function?
A function is a variable that stores multiple data values.
A function is a type of loop used to repeat tasks in programming.
A function is a block of code designed to perform a particular task, which can be reused in a program.
A function is a command that only prints messages to the screen.
What is the role of db.json?
It serves as a configuration file for setting up the application's database connection.
It stores test data used to simulate database functionality in a development environment.
It contains encrypted keys and credentials for secure API access.
It is used to define routes and API endpoints for the backend server
In which building is Moringa School located?
Ngong Lane
Ngong Lane Plaza
Ngong Road Plaza
What keyword can be used to declare a variable in JavaScript?
let
int
var
Both A and C
What is the output of this code?
let x = 10;
let y = 5;
console.log(x + y);
10
5
105
15
What is the correct way to check the type of a variable in JavaScript?
typeOf(variable)
typeof(variable)
getType(variable)
checkType(variable)
How do you access the first element of an array in JavaScript?
let fruits = ["apple", "banana", "cherry"];
fruits[0]
fruits[1]
fruits[first]
fruits[2]
What does the following code output?
let colors = ["red", "blue"];
colors.push("green");
console.log(colors);
["red", "blue", "green"]
["green", "red", "blue"]
["red", "blue"]
["green", "red", "blue", "green"]
What is the correct way to select an element with the ID header in JavaScript?
document.querySelector("#header")
document.getElementById("header")
document.getElementsByClassName("header")
Both A and B
How do you add a new property to an object?
let person = { name: 'John' };
person('age') = 25;
person.age: 25;
person.age = 25;
Which method adds a new element to the end of an array?
unshift()
push()
pop()
What is the role of response.json() in a fetch request in JavaScript?
fetch('https://jsonplaceholder.typicode.com/posts/1')
.then(response => response.json(); )
.then((data) => {
console.log('Post data:', data);
})
It parses the JSON string from the response body into a JavaScript object.
It sends JSON data to the server.
It converts JavaScript objects into JSON format
