I have a Object with 12 booleans, I want get only the values true and insert in my ArrayList, but I get error.
let arrayMonths: Array<string> = function () {
let array: Array<string>;
let obKeys = Object.keys(this.months), prop: string;
for (prop of obKeys) {
if (this.months[prop]) {
array.push(this.service.months[prop]);
}
}
return array;
}
error:
"message": "The type '() => string []' can not be assigned to the type 'string []'. \ n The 'press' property is missing in the type '() => string []'." ,