The suggested answer to this question using find does not work in Typescript, it cannot compile. I've looked at other similar questions, but they all seem a little different (context) in some way.
This is the array:
categories: Category[] = [];
This is Category object:
export class Category{
constructor(
id: string,
name: string,
category_types: Object[]
) {}
}
and I am trying to find like this (value is a string, eg 'Wood'):
let a = this.categories.find(v => v.name === value);
It says Property name does not exist on type 'Category'.