Handlbars JS : evaluating expression with dynamic keys

I have object as follows

myObject = {
     id:1234,
     name_1234:"abc"
}

using the handlebars JS i am trying to evaluate the expression with dynamic keys in place, for example the id is generated dynamically so the keys will change dynamically

therefore the expression below

{{"myObject.name_"+myObject.id}}

should return the output "abc".

Is something like this achievable in handlebars JS ?

133 thoughts on “Handlbars JS : evaluating expression with dynamic keys”

Leave a Comment