Implement a function pairs(array) that returns an object composed from key-value pairs.
array: An array of arrays, where each inner array has exactly two elements: [key, value].The function should return an object where the first element of each inner array becomes the key, and the second element becomes the value.
Example
pairs([['a', 1], ['b', 2]]); // { a: 1, b: 2 } pairs([['name', 'Alice'], ['age', 25]]); // { name: 'Alice', age: 25 } pairs([]); // {}
JavaScript Function
No test results yet
Click "Run" to execute tests