const assetMap = {
General: {
name: 'Common',
bkgHex: '#eee',
fontHex: '#aaa',
},
...
const getAsset = (name, type) => {
return assetMap.name.type;
}
console.log( getAsset('General', 'name') );
An error occurred:
Uncaught TypeError: Cannot read property 'type' of undefined