I have a js object like:
obj = { name: \'js\', age: 20 };
now i want to access name field of obj, but i can only get string \'name\', s
Not related at all, but for anyone trying to define object's field name from a string variable, you could try with:
const field = 'asdf' const obj = {[field]: 123} document.body.innerHTML = obj.asdf