JavaScript — Test 1
Page 1 of 3
Question 1
In JavaScript, what do null == undefined and null === undefined evaluate to?
FPSC- Programmer (BS-17) - PMD High Yield - 2026
Question 2
What does [10, 1, 2].sort() return in JavaScript?
FPSC- Programmer (BS-17) - PMD High Yield - 2026
Question 3
What does this log?
console.log(x);
var x = 5;
FPSC- Programmer (BS-17) - PMD High Yield - 2026
Question 4
What does this log?
for (var i = 0; i < 3; i++)
setTimeout(() => console.log(i), 0);
FPSC- Programmer (BS-17) - PMD High Yield - 2026
Question 5
In what order does this code log?
console.log('A');
setTimeout(() => console.log('B'), 0);
Promise.resolve().then(() => console.log('C'));
console.log('D');
FPSC- Programmer (BS-17) - PMD High Yield - 2026
Question 6
With const obj = {a: 1};, what happens with obj.a = 2;?
FPSC- Programmer (BS-17) - Pakistan Meteorological Department (PMD) Model Papers - 2026
Question 7
What does parseInt(0.0000005) return?
FPSC- Programmer (BS-17) - PMD High Yield - 2026
Question 8
What does [] + {} evaluate to in JavaScript?
FPSC- Programmer (BS-17) - Pakistan Meteorological Department (PMD) Model Papers - 2026
Question 9
With let arr = [1, 2, 3]; arr[10] = 5;, what is arr.length?
FPSC- Programmer (BS-17) - Pakistan Meteorological Department (PMD) Model Papers - 2026
Question 10
What does Math.max() (called with no arguments) return?
FPSC- Programmer (BS-17) - Pakistan Meteorological Department (PMD) Model Papers - 2026