I have an enum defined like this :
export enum ViewSide {
Left = 'left',
Right = 'right'
}
But when I try to use it, it doesn't work as intended:
console.log(ViewSide); // return {0: "LEFT", 1: "RIGHT", LEFT: 0, RIGHT: 1}
console.log(ViewSide.Right); // return undefined instead of 'right'
console.log(ViewSide['Right']); // return undefined
I have used similar enums, but they works correctly and return the string.
Any idea ?
EDIT: Turns out it was just a cache problem. I had defined the enum without the string before, and it stayed like this for a while.