Skip to content

Latest commit

 

History

History
16 lines (12 loc) · 436 Bytes

File metadata and controls

16 lines (12 loc) · 436 Bytes

Create Object

Create an object from a given array

Instructions

  • You would receive an array as an input
  • The array contains their key and value as alternate elements, starting with the key
  • Create an object from the array with their key values
Example:
Input - ["firstName", "Yash", "lastName": "Goyal"]
Output - { firstName: "Yash", lastName: "Goyal" }

Run npm run test:file create_object to test your code