This is actually not an array, it is a nested object of objects. So each nested object have a pair of key and value.
let's say we got strings as key and
{
FIRST: 'First Value',
SECOND: 'Second Value',
THIRD: 'Third Value',
}
as value (in this particular case, the value itself is an object too), so each key and value have to be separated by a colon.
Then, each pair should look like the below example instead of provided one:
strings: {
FIRST: 'First Value',
SECOND: 'Second Value',
THIRD: 'Third Value',
}
You are getting an error in this case because you used = instead of a colon (:) and it won't be recognized as an object.
So your final object should be something like this:
var Constants = {
strings: {
FIRST: 'First Value',
SECOND: 'Second Value',
THIRD: 'Third Value',
},
numbers: {
FIRST: 1,
SECOND: 2,
THIRD: 3,
}
};
console.log(Constants.strings.FIRST)
console.log(Constants.numbers.FIRST)
=signs for: