wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Phase 1 Recap

Total questions: 13

Worksheet time: 5mins

Name
Class
Date
1.

Who is the CEO of Moringa School?

a)

Snehar Shah

b)

Nikki Germany

2.

What is a function?

a)
  • A function is a variable that stores multiple data values.

b)
  • A function is a type of loop used to repeat tasks in programming.

c)
  • A function is a block of code designed to perform a particular task, which can be reused in a program.

d)
  • A function is a command that only prints messages to the screen.

3.

What is the role of db.json?

a)
  • It serves as a configuration file for setting up the application's database connection.

b)
  • It stores test data used to simulate database functionality in a development environment.

c)
  • It contains encrypted keys and credentials for secure API access.

d)
  • It is used to define routes and API endpoints for the backend server

4.

In which building is Moringa School located?

a)

Ngong Lane

b)

Ngong Lane Plaza

c)

Ngong Road Plaza

5.

What keyword can be used to declare a variable in JavaScript?

a)

let

b)

int

c)

var

d)
  • Both A and C

6.

What is the output of this code?

let x = 10;

let y = 5;

console.log(x + y);

a)
  • 10

b)

5

c)

105

d)

15

7.

What is the correct way to check the type of a variable in JavaScript?

a)
  • typeOf(variable)

b)
  • typeof(variable)

c)
  • getType(variable)

d)
  • checkType(variable)

8.

How do you access the first element of an array in JavaScript?

let fruits = ["apple", "banana", "cherry"];

a)

fruits[0]

b)

fruits[1]

c)

fruits[first]

d)

fruits[2]

9.

What does the following code output?

let colors = ["red", "blue"];

colors.push("green");

console.log(colors);

a)
  • ["red", "blue", "green"]

b)
  • ["green", "red", "blue"]

c)
  • ["red", "blue"]

d)
  • ["green", "red", "blue", "green"]

10.

What is the correct way to select an element with the ID header in JavaScript?

a)
  • document.querySelector("#header")

b)
  • document.getElementById("header")

c)
  • document.getElementsByClassName("header")

d)
  • Both A and B

11.

How do you add a new property to an object?

let person = { name: 'John' };

a)

person('age') = 25;

b)

person.age: 25;

c)

person.age = 25;

12.

Which method adds a new element to the end of an array?

a)

unshift()

b)

push()

c)

pop()

13.

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);

})

a)

It parses the JSON string from the response body into a JavaScript object.

b)

It sends JSON data to the server.

c)

It converts JavaScript objects into JSON format