Upon compiling my TypeScript file, I encountered an error message that states:
Error: Operator '>' cannot be applied to types 'void' and 'number'
Any suggestions on how to resolve this issue would be greatly appreciated.
Below is the section of code causing the error:
this.languages.forEach((o: any, i: any) => {
const control1 = new FormControl(this.UserSelectedLanguages.indexOf(o.id) > -1); // if first item set to true, else false
(this.languageform.controls.selectedlang as FormArray).push(control1);
});