Modern Programming Languages MCQs with Answers
Practice important Modern Programming Languages MCQs with answers and explanations.
Multiple Choice Questions
Q771: Objects in JavaScript can contain both ____ and _____.
- A: Strings and arrays
- B: Properties and methods
- C: Numbers and Booleans
- D: Functions and variables
View Answer
B
Q772: Fill in the blank: In JavaScript, the ______ provides access to HTML elements within a webpage.
- A: Browser Object Model (BOM)
- B: Document Object Model (DOM)
- C: Built-in Object Model
- D: User-defined Object Model
View Answer
B
Q773: Which object in JavaScript can access browser window characteristics?
- A: Navigator Object
- B: Browser Object Model (BOM)
- C: Document Object Model (DOM)
- D: Window Object
View Answer
B
Q774: What is the correct syntax for the write method of the document object?
- A: document.write("text")
- B: doc.write("text")
- C: documentWrite("text")
- D: docWrite("text")
View Answer
A
Q775: In JavaScript, a variable of type object may have its properties accessed using:
- A: Object notation
- B: Dot notation
- C: Property brackets
- D: Function calls
View Answer
B
Q776: Which object provides access to browser history in JavaScript?
- A: Navigator Object
- B: History Object
- C: Window Object
- D: DOM Object
View Answer
B
Q777: What is the purpose of the "with" statement in JavaScript?
- A: Declare a new variable
- B: Simplify repetitive code with an object
- C: Close open objects
- D: Call a function
View Answer
B
Q778: Fill in the blank: An ordered set of values grouped under a single identifier in JavaScript is called a/an ______.
- A: Object
- B: Array
- C: Method
- D: Class
View Answer
B
Q779: In the code document.write("Hello World");, the write method is part of which object?
- A: Window Object
- B: Document Object
- C: Navigator Object
- D: Browser Object
View Answer
B
Q780: What is a reserved word in programming languages?
- A: A word used for comments
- B: A word special only in certain contexts
- C: A word not allowed as a user-defined name
- D: A variable used in loops
View Answer
C