Error TS2339: Property 'split' does not exist on type 'string | string[]'. Property 'split' does not exist on type 'string[]'

When I build my application I get. error TS2339: Property "split" does not exist on type "string | string[]". Property "split" does not exist on type "string[]". How can a split not exist on a string or string[].
Ankur Rajput
Asked 11-10-2020
12

Answer (1)
this.imageFileArray.push((reader.result as string).split(",")[1]); this.imageFileArray.push((<string>reader.result).split(",")[1]);
Deepak Sharma
Asked 13-12-2019
45 Likes
Comments
Write comment

Submit your answer