I would like to get the values of object without aura iteration

let buttonList = tempRes.buttonList;
            var btnObj = [] ;

I know to get it through aura:iterator. Is there any alternative?. Please help.

Can I do something like this in aura

const map1 = new Map();
map1.set('bar', {'test':123,'test2':2333});
 map1.set('bar1', 'foo00000');

Is this possible?

<aura:if istrue="map1.has('bar'))">
<button value={!map1.get('bar').test}/>

1 Answer 1


No, there is no function in Aura to check if a Map contains a value. Instead, you will need to check for the value in your JavaScript controller or helper (similar to your example with Map.has) and store the value in a way that is referenceable in your component markup.

.js controller or helper

const map1 = new Map();
map1.set('bar', {'test':123,'test2':2333});
map1.set('bar1', 'foo00000');
component.set('v.hasBar', map1.has('bar'));


<aura:if isTrue="{!v.hasBar}"
    <p>true outcome</p>

However, if you need to iterate over results that exist within the Map, you can do that too by taking Map.values() and putting them into an array that <aura:iterate /> can walk over.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .