I am looking to work with multiple titles, such as title1, title2, title3, and so on. How can I create a variable that dynamically fetches the value of these fields?
function getTitle(i){
var myScope={}
myScope["title"+i]="title"+i // Is there a better way to utilize this? And how?
var output = props.attributes.title1 // This current approach is static. Instead of using just 1, I want to concatenate the value of i like:
var output = props.attributes.title+i
return output
}
I aim to append the value of i to the word 'title', creating outputs like title1 or title2, etc.