I am trying to determine how many matches/true values there are based on the values of all objects in an array, compared to an enums value. My array of objects is structured like this:
const jobs = [{
description,
title,
}...
]
In addition, I have defined an enum:
enum jobFailureStatus {
value1,
value2,
...
}
My goal is to compare the "description" property to any of the enum values and retrieve an array of true/false results. So far, my attempt looks like this:
const found = this.jobs?.some((item) => item.description?.includes(Object.values(jobFailureStatus)))
However, I encounter a type mismatch error as follows:
Argument of type '(string | jobFailureStatus)[]' is not assignable to parameter of type 'string'
Is there a way to adjust the above function to eliminate the type mismatch issue?