JavaScript Programming
Final Assessment (Qns & Ans)
2025
General Instructions
1. Read All Questions Carefully: Make sure you understand each question.
2. Time Management: You have a specific amount of time to complete the exam.
Keep an eye on the clock and pace yourself.
3. Allowed Materials: Only use materials that are explicitly allowed. Unauthorized
materials can lead to disqualification.
4. ANS Format: Follow the required format for your ANS. For example, multiple-
choice questions might need you to select the best ANS, while essay questions
require detailed responses.
5. Academic Integrity: Adhere to the university's honor code. Any form of cheating or
plagiarism is strictly prohibited.
6. Technical Requirements: Ensure your computer and internet connection are
stable. For online exams, you might need a webcam and microphone for proctoring
purposes.
7. Submission: Submit your ANS before the time expires. Late submissions might
not be accepted.
©2024/2025
,1. Which of the following methods can be used to create a new
object in JavaScript?
A) Object.create()
B) new Object()
C) {}
D) All of the above
Correct ANS: D
Rationale: All listed methods are valid ways to create new
objects in JavaScript.
2. What is the purpose of the 'this' keyword in JavaScript?
A) Refers to the current instance of an object
B) Refers to the global object
C) Initializes a variable
D) None of the above
Correct ANS: A
©2024/2025
, Rationale: The 'this' keyword refers to the current context in
which a function is called, typically pointing to the instance of the
object within that scope.
3. Which of the following is a feature of ES6 (ECMAScript
2015)?
A) const
B) let
C) Arrow functions
D) All of the above
Correct ANS: D
Rationale: All listed options are features introduced in ES6.
4. What will be the output of the following code snippet?
```javascript
var x = 10;
function test() {
console.log(x);
var x = 20;
}
©2024/2025
, test();
```
A) 10
B) 20
C) ReferenceError
D) undefined
Correct ANS: D
Rationale: The variable 'x' is hoisted but remains undefined
until assigned, thus logging 'undefined'.
5. Which method can be used to convert a JSON string into a
JavaScript object?
A) JSON.decode()
B) JSON.stringify()
C) JSON.parse()
D) JSON.objectify()
Correct ANS: C
Rationale: JSON.parse() is the correct method to convert a
JSON string into a JavaScript object.
©2024/2025