I am trying to create the boolean variable hasMultipleCoverageLines
in order to determine whether there are multiple unique values for coverageLineName
within the coverageLines
items. Is there a more efficient way to write this logic without explicitly checking each individual coverageLineName
?
this.hasMultipleCoverageLines = !this.coverageLines.every((x) => x.coverageLineName === "Medical")
&& !this.coverageLines.every((x) => x.coverageLineName === "Dental")
&& !this.coverageLines.every((x) => x.coverageLineName === "Vision")
&& !this.coverageLines.every((x) => x.coverageLineName === "Life");