I tried to extract strings using an enumeration, for example:
var INGREDIENT = { COFFEE: "coffee"}
and then later wanted to have a cost scale for ingredients
var COST = { coffee: 1 }
but I wanted to extract coffee to use the line: INGREDIENT.COFFEE like this:
var COST = {INGREDIENT.COFFEE: 1 };
but he showed an error that .is incorrect.
I resorted to:
var COST= {};
COST[INGREDIENT.COFFEE] = 1;
Is there something that I do, not letting me do it like mine //target
source
share