I recently saw a code like below
type TestType = {
foo: string;
};
const Test = ({
foo: bar,
}) => {
console.log(bar)
}
Test({foo: "hello world"})
I'm not sure about how foo:bar
part works. Does bar
automatically point to whatever value passed to key foo
? I'd appreciate if someone can let me know what this is called or any other materials I can read. Thank you so much!