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

/15

Computer Chapter 3 : Topic 3.2

Variable assignment in JavaScript

1 / 15

A student creates a variable and assigns the value 20 to it for storing a user's age on a webpage. What is this process called?

2 / 15

Consider the statement let score = 50; used in a JavaScript program. Which part of the statement assigns the value to the variable?

3 / 15

A programmer wants to store the value "Ali" in a variable named studentName. Which statement correctly performs this assignment?

4 / 15

A variable named marks already contains the value 60. What will be the new value after executing marks = 80;?

5 / 15

A programmer writes let x = 5; let y = x;. What value will be stored in y?

6 / 15

A student wants to update the value of a variable during program execution. Which JavaScript feature allows this?

7 / 15

Consider the code: let price = 100; price = 120; What value will price contain after execution?

8 / 15

A student writes let total = 15 + 10;. What value is assigned to total?

9 / 15

Which statement correctly assigns the Boolean value true to a variable named isLoggedIn?

10 / 15

A programmer assigns city = "Lahore"; and later executes city = "Karachi";. What happens?

11 / 15

A student creates the statement let num = 7; num = num + 3;. What is the final value of num?

12 / 15

Which of the following statements assigns the value stored in variable a to variable b?

13 / 15

A web application stores the number of visitors in a variable. Why is reassignment useful in this situation?

14 / 15

What will be the value of result after executing the following code? let result = 12; result = result * 2;

15 / 15

A programmer assigns different types of values to the same variable at different times. Which statement best describes JavaScript behavior?

Your score is

0%

9th class objective books