Machine-translated by Google. Questions are authored in English.
Top

Discussion

Which of the following statements is/are true ?

P : In a scripting language like JavaScript, types are typically associated with values, not variables.
Q : It is not possible to show images on a web page without the <img> tag of HTML.

Select the correct answer from the options given below :

  • A.P only
  • B.Q only
  • C.Both P and Q
  • D.Neither P nor Q

Answer: A

The answer is P only.

Statement P is true: JavaScript is dynamically typed, so a variable can hold a number at one moment and a string the next; the type belongs to the value, not to the variable.

Statement Q is false: images can be shown without the img tag, for example as CSS background images, through the picture or object elements, or drawn with canvas or SVG. So 'Q only', 'Both' and 'Neither' are wrong.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.