これだと、単に変数に文字列 "a" を代入しただけに思えるけど
どうしてobjのプロパティが代入されるんですか?

const obj = {a: 10, b:20};
const num = 'a';
console.log(obj[num]); // 10