JavaScript Programmer Certification Exam Questions, Exams of Technology

A set of questions and answers related to javascript programming, likely intended for exam preparation or self-assessment. It covers fundamental concepts such as object creation, property access, inheritance, string manipulation, and asynchronous programming. Each question is followed by the correct answer and a brief explanation, making it a useful resource for students or professionals looking to test their knowledge of javascript. The questions are designed to assess understanding of core language features and best practices, providing valuable insights into the key areas of javascript development. This resource is ideal for those preparing for a javascript certification exam or seeking to reinforce their understanding of the language.

Typology: Exams

2024/2025

Available from 10/24/2025

anil-kumar-jain-1
anil-kumar-jain-1 🇮🇳

2.9

(15)

27K documents

1 / 191

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
JSA 41 01JSA Certified Associate
JavaScript Programmer Certified
Ophthalmic Assistant Exam
Question 1. Which method creates a new object with a specified
prototype in JavaScript?
A) Object.defineProperty()
B) Object.create()
C) Object.assign()
D) Object.freeze()
Answer: B
Explanation: Object.create() is used to create a new object with the
specified prototype object.
Question 2. What is the correct syntax to access a property called
"name" in an object called user?
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download JavaScript Programmer Certification Exam Questions and more Exams Technology in PDF only on Docsity!

JavaScript Programmer Certified

Ophthalmic Assistant Exam

Question 1. Which method creates a new object with a specified prototype in JavaScript? A) Object.defineProperty() B) Object.create() C) Object.assign() D) Object.freeze() Answer: B Explanation: Object.create() is used to create a new object with the specified prototype object. Question 2. What is the correct syntax to access a property called "name" in an object called user?

JavaScript Programmer Certified

Ophthalmic Assistant Exam

A) user(name) B) user->name C) user.name D) user:name Answer: C Explanation: Dot notation (user.name) is the standard way to access a property in JavaScript. Question 3. How can you check if an object has a property as its own property (not inherited)? A) object.in(property) B) property in object

JavaScript Programmer Certified

Ophthalmic Assistant Exam

Answer: B Explanation: The delete operator removes a property from an object. Question 5. How do you enumerate all keys (own and inherited) of an object? A) Object.keys(obj) B) Object.values(obj) C) for...in loop D) Object.entries(obj) Answer: C Explanation: The for...in loop iterates over all enumerable properties, including inherited ones.

JavaScript Programmer Certified

Ophthalmic Assistant Exam

Question 6. What is the result of comparing two different objects with the same properties using == or ===? A) true B) false C) undefined D) Throws error Answer: B Explanation: Objects are compared by reference, not by value, so different objects are never equal.

JavaScript Programmer Certified

Ophthalmic Assistant Exam

A) Refers to parent function B) Refers to the global object always C) Refers to the object the method is called on D) Refers to the class only Answer: C Explanation: "this" within a method refers to the object from which the method is called. Question 9. How do you define a getter for a property "fullName" in an object? A) get fullName() {} B) function get fullName() {}

JavaScript Programmer Certified

Ophthalmic Assistant Exam

C) fullName.get = function() {} D) fullName() {} Answer: A Explanation: The proper getter syntax is get fullName() {} inside the object. Question 10. What does Object.freeze(obj) do? A) Prevents adding or removing properties B) Makes object immutable C) Prevents modification of existing properties’ values D) All of the above Answer: D

JavaScript Programmer Certified

Ophthalmic Assistant Exam

A) class B extends A B) class B inherits A C) class B : A D) class B - > A Answer: A Explanation: The extends keyword implements inheritance between classes in ES6. Question 13. How can you call a parent class constructor from a subclass in JavaScript? A) super() B) parent()

JavaScript Programmer Certified

Ophthalmic Assistant Exam

C) this.super() D) extends() Answer: A Explanation: super() is used inside the subclass constructor to call the parent class constructor. Question 14. Which method defines a static property in a class? A) static myMethod() {} B) static: myMethod() {} C) myMethod static() {} D) myMethod() static {} Answer: A

JavaScript Programmer Certified

Ophthalmic Assistant Exam

Question 16. Which method converts a string to uppercase in JavaScript? A) toUpper() B) uppercase() C) toUpperCase() D) makeUpperCase() Answer: C Explanation: toUpperCase() converts all the letters in a string to uppercase. Question 17. What does arr.splice(1,2) do in an array [0,1,2,3,4]? A) Removes 2 elements starting from index 1

JavaScript Programmer Certified

Ophthalmic Assistant Exam

B) Adds 2 elements at index 1 C) Returns the first two elements D) Splits the array in half Answer: A Explanation: splice(1,2) removes 2 elements starting from index 1. Question 18. Which method finds the first element matching a condition in an array? A) find() B) filter() C) map() D) sort()

JavaScript Programmer Certified

Ophthalmic Assistant Exam

Explanation: Set only allows unique values and automatically removes duplicates. Question 20. Which method adds or updates an entry in a Map object? A) set() B) put() C) add() D) insert() Answer: A Explanation: set() is used to add or update entries in a Map. Question 21. What is the output of JSON.stringify({a:1, b:2})?

JavaScript Programmer Certified

Ophthalmic Assistant Exam

A) {a:1,b:2} B) "a:1,b:2" C) '{"a":1,"b":2}' D) undefined Answer: C Explanation: JSON.stringify() converts objects into a JSON string. Question 22. How do you test a string for a regular expression match in JavaScript? A) test() B) exec() C) match()

JavaScript Programmer Certified

Ophthalmic Assistant Exam

Explanation: Extending built-in prototypes can cause conflicts and unexpected behavior. Question 24. What is a generator function in JavaScript? A) A function that generates random numbers B) A function that can pause and resume execution C) A function that returns another function D) A function that runs asynchronously Answer: B Explanation: Generator functions can pause execution and resume later, using the yield keyword.

JavaScript Programmer Certified

Ophthalmic Assistant Exam

Question 25. What is the syntax to define a generator function? A) function* myGen() {} B) generator myGen() {} C) function myGen() {} D) function myGen() yield {} Answer: A Explanation: The asterisk after function (function) defines a generator function. Question 26. What is the purpose of Promise.all()? A) To resolve the fastest promise B) To wait for all promises to resolve or any to reject