我有一个字符串数组,想要保留这些值并创建一个新的数组 Record。
对于 userValue 中的每个值:
例子
userValue: string[] = ["1111","2222","3333","4444"];
selectedOptions: Record<string, boolean> = {
//how to add userValue array into here?
1111: true, //hardcoded
2222: true, //hardcoded
3333: true, //hardcoded
4444: true //hardcoded
};