Answer the question
In order to leave comments, you need to log in
How to get a property from a string by name?
const elements = {
attributes: {
text: "Привет"
}
}
function getKey(key){
return elements.attributes.key;
}
let value = getKey("text"); // elements.attributes.text - "Привет"
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question