Salesforce JavaScript Developer Practice Exam 2026 – Your All-in-One Guide to Exam Success!

Session length

1 / 20

What will Object.keys(emp) return if emp = {name: "Santanu", dept: "IT"}?

Array ["name", "dept"]

When calling `Object.keys(emp)` where `emp` is defined as `{name: "Santanu", dept: "IT"}`, the method will return an array containing the property names of the `emp` object.

In this case, the properties are `name` and `dept`. The `Object.keys()` method retrieves an array of a given object's own enumerable property names in the same order that they would be iterated with a `for...in` loop.

Since `emp` contains two properties, the output will be an array: `["name", "dept"]`. This precisely matches the given answer choice, making it the correct response to the question. The other options either represent different data structures or formats that are not applicable in this context.

Object {name: "Santanu", dept: "IT"}

String "name, dept"

Object.keys is not usable on emp

Next Question
Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy