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?



32.3k

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


2.6k

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


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


32.3k

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