Hello, I’m studying LEARN TYPESCRIPT: FUNDAMENTALS now.
I’m doing TypeMart in it, then occured weird error again and again.
the link is below:
https://www.codecademy.com/courses/learn-typescript-fundamentals/projects/typemart
I got unstuck at task3,
I used find() method on products for product, but it made error and it is below.
index.ts:12:26 - error TS2550: Property ‘find’ does not exist on type ‘{ name: string; price: string; preOrder: string; }’. Do you need to change your target library? Try changing the ‘lib’ compiler option to ‘es2015’ or later.
12 const product = products.find(p => p.name === productName);
but, when I use filter(), it works. I really don’t know why, and it’s even said to use find() on hint box!
I’ve just started to study Typescript, so many things are new for me.
Please help me.
Thank you.