Closed as not planned
Description
Bug Report
π Search Terms
is:issue enum duplicate key value double extra entries flipped
π Version & Regression Information
Found in v~4.7.2
β― Playground Link
Playground link with relevant code
π» Code
enum TransactionTypes {
A = 1,
B = 2,
C = 3,
D = 4,
E = 5,
F = 6,
G = 7,
H = 8,
}
console.log('Keys:' + Object.keys(TransactionTypes))
console.log('Values: ' + Object.values(TransactionTypes))
for(let i = 0; i < Object.keys(TransactionTypes).length; i++) {
console.log(`Pair: ${Object.keys(TransactionTypes)[i]} - ${Object.values(TransactionTypes)[i]}`)
}
π Actual behavior
Enums shows double the amount of entries; shows key-value pairs twice where the second set (extra entries) are the original keys and values 'flipped'.
π Expected behavior
Show key value pairs once; only one set of the key values declared.