A neat way of doing this would be:
make an object as :
const data = {
abc: {
key: 'abc',
value: '123',
},
def: {
key: 'def',
value: '456',
}
}
and then when you want to access them, you can do :
alert ("value of" +data.abc.key +"is"+ data.abc.value +"and value of" +data.def.key+" is"+data.def.value );
or
const abc = {key: 'abc', value: '123'};
const def = {key: 'def', value: '456'};
alert ("value of" +abc.key +"is"+ abc.value +"and value of" +def.key+" is"+def.value );