Objective: Extract the property names (keys) from an object and return them in an array.
Define an Object:
Create an object named
personwith the following properties:firstNamewith the valueJohnlastNamewith the valueDoeagewith the value30occupationwith the valueEngineer
Extract the Property Names:
Use a function to extract all the property names (keys) of the
personobject and store them in an array.Return this array as a variable named
keys_array.
Submit Your Result:
Submit your result contained in the variable
keys_array.
Expected Result:
Submit the variable keys_array as your answer. See example below:
Install the snippet to get started: https://www.xano.com/snippet/XwN5GThx