FPSC Past Papers MCQs

FPSC Programmer (BS 17) PMD High Yield 2026  — 350 MCQs  (Page 34 of 35)

Practice FPSC Past Papers MCQs with solved questions from real past exams. These MCQs cover FPSC Programmer (BS 17) PMD High Yield 2026 past papers and are ideal for candidates preparing for competitive exams.

View Tests (30 MCQs each)
In JavaScript, what do null == undefined and null === undefined evaluate to?
  • true and true
  • false and true
  • true and false
  • false and false
What does [10, 1, 2].sort() return in JavaScript?
  • [10, 2, 1]
  • [1, 10, 2]
  • [1, 2, 10]
  • TypeError
What does this log? console.log(x); var x = 5;
  • 5
  • null
  • undefined
  • ReferenceError
What does this log? const obj = { name: 'PMD', show: () => console.log(this.name) }; obj.show();
  • PMD
  • ReferenceError
  • obj
  • undefined (in a browser module or script, this is not obj)
What happens with fetch('/api/missing') when the server responds with 404?
  • The promise resolves normally, with response.ok set to false; fetch rejects only on network failure
  • It retries automatically
  • The promise rejects with an error
  • It throws a SyntaxError
What is the difference between innerHTML and textContent?
  • textContent parses HTML
  • innerHTML parses its value as HTML (an XSS risk with untrusted data); textContent treats it as plain text
  • innerHTML escapes all tags
  • They are identical
Which approach is the correct primary defense against SQL injection?
  • Hiding error messages
  • Using HTTPS
  • Parameterized queries (prepared statements)
  • Client-side input validation