I would like to know how I can create a loop that is repeated for each item of the enum and still validate that I am in the correct enum (index)
for('for each or for in?') {
if (list.names === enum) {
console.log(enum)
}
}
enum = {
JAMES: 'James',
MARCO: 'Marco',
Jane: 'Jane'
}
This code is just an example of what I would like to do, repeat the loop for each type of enum, then validate that I am in the first, second, etc., and then print the current enum
for (const newNames in enum) {
console.log(newNames[enum])
}