Can you guide me on defining the return type for this function?
function mapArrayToObjByKeys(range: [string, string], keys: { start: string; end: string }) {
return {
[keys.start]: range[0],
[keys.end]: range[1]
}
}
For instance:
mapArrayToObjByKeys(['a', 'b'], { start: 'beginning', end: 'ending' })
I'm looking for intelligent code suggestions like 'beginning' and 'ending' in vscode.