How to set associative array in volt?

I want to set associative array in volt

{% set tempKey = "Name" %}

{% set tempArray[tempKey] = "Mike" %}

how to do that?



28.9k

{% set array = ['key': value] %}


2.4k

Hi, But if the Key is another variable, it's not working


{% set array = ['key': value] %}


28.9k

Yeah, you're right, 'cause you can't put a variable like a key. key is a string value, not a variable.