FBISE, NCP & NBF-aligned resources for Classes 9–12

/30

Computer Chapter 3 : Topic 3.1

Variables, Data Types and Arrays in JavaScript

1 / 30

A student is creating a dynamic website and wants to store a user's name so that it can be displayed later on different parts of the webpage. Which JavaScript feature should be used?

2 / 30

While developing a webpage, a programmer stores the value 25 in a variable. Which JavaScript data type is most suitable for this value?

3 / 30

A web application asks users whether they agree to terms and conditions. Which data type is most appropriate for storing the response as either true or false?

4 / 30

A student stores the value "Pakistan" in a JavaScript variable. Which statement correctly describes this value?

5 / 30

A programmer wants to store the marks of five subjects in a single variable-like structure. Which JavaScript feature is most suitable?

6 / 30

Which statement best explains why arrays are useful in dynamic websites and web applications?

7 / 30

A variable contains the value "123". How will JavaScript most likely treat this value?

8 / 30

A student writes the following code: let age = 15;. What is the purpose of age in this statement?

9 / 30

A website stores the names of registered users in an array. What is the main advantage of this approach?

10 / 30

Which of the following values would most likely be stored as a Boolean in a JavaScript program?

11 / 30

A programmer creates an array containing the values ["Red", "Blue", "Green"]. What kind of data is being stored?

12 / 30

During form validation, a variable stores whether a password is correct. Which data type is most suitable?

13 / 30

A student wants to store a user's age and later perform calculations with it. Which data type should be used?

14 / 30

A programmer uses an array to store monthly sales data. What characteristic makes an array appropriate for this task?

15 / 30

Which of the following JavaScript values represents a Number data type?

16 / 30

A website displays a welcome message using a user's name stored in a variable. What benefit does this provide?

17 / 30

A programmer accidentally stores a student's roll number as "101" instead of 101. What is the major difference?

18 / 30

Which scenario would most likely require the use of an array rather than a single variable?

19 / 30

A dynamic website updates product prices regularly. Why are variables important in this situation?

20 / 30

Which of the following sets of values could correctly be stored inside a JavaScript array?

21 / 30

A programmer stores the value true in a variable named isMember. What information does this variable most likely represent?

22 / 30

Which statement best describes a JavaScript variable?

23 / 30

A web developer stores the names of seven days in an array. Why is this better than creating seven separate variables?

24 / 30

A variable contains the value false. Which statement is true regarding its data type?

25 / 30

In a JavaScript-based quiz application, which structure is most suitable for storing all quiz questions together?

26 / 30

A student wants a variable to hold different values during program execution. Which feature of variables makes this possible?

27 / 30

Which of the following examples demonstrates data commonly stored in a String variable on a website?

28 / 30

A shopping website stores product names in an array. What would happen if a new product needs to be added?

29 / 30

Which combination correctly matches the value with its data type?

30 / 30

A student is building a dynamic website using JavaScript. Which combination of concepts is most important for storing, organizing, and manipulating data?

Your score is

0%

9th class objective books