Write JavaScript function (or JS program) that composes an object by given properties. There will be 3 sets of property-value pairs (a total of 6 elements). Assign each value to its respective property of an object and return the object as a result of the function.
The input comes as an array of string elements.
Examples:
Input:
['name', 'Pesho', 'age', '23', 'gender', 'male']
Output:
{ name: 'Pesho', age: '23', gender: 'male' }
Input:
['ssid', '90127461', 'status', 'admin', 'expires', '600']
Output:
{ ssid: '90127461', status: 'admin', expires: '600' }
The output should be returned as a value.