When transitioning code from JavaScript (JS) to TypeScript (TS), the main difference lies in the concept of strongly typing your code.
Fortunately, when migrating JS code to TS, you may not need to make any changes, as the TS transpiler can usually infer the types of variables automatically. However, if you do want to explicitly enforce the type for variables, you can use an index signature as shown below:
interface channelObj {
[key: string]: string
} // Index signature for typing object key-value pairs
const channel: channelObj = {},
arr: string[] = [string, ...];
for(let i = 0;i < arr.length;i++ ){
channel[arr[i]] = "Amo" // Setting equal string value for each key
}