I am currently working with two objects, objA and objB.
There is a function that I have, which takes a value from objB and a key from objA as arguments.
const objA = {
a:"a",
b:"b"
}
const objB = {
a:"a",
b:"b"
}
checkValues = (type:string,key:keyof typeof objA)=>{
return objA[key] === type;
}
checkValues("A",objA.a)
However, I am encountering a type error message stating:
Argument of type 'string' is not assignable to parameter of type '"a" | "b"'