Open Rizl11 opened 7 months ago
'string' only refers to a type, but is being used as a value here. Line with x. Push returns a number, but i want a string array as returntype
Solution:
interface Add { ArrayID: string[]; ID: string; Add(ArrayID: string[], ID: string): string[]; } // Functions class AddRowIdToArray implements Add { ArrayID = []; ID = ''; Add(ArrayID, ID) { ArrayID = ArrayID.push(ID); return ArrayID; }; }
Problem Code
`// Function Interfaces interface Add { ArrayID: string[]; ID: string; Add(ArrayID: string[], ID: string): string[]; } // Functions class AddRowIdToArray implements Add { ArrayID: string[] = []; ID: string = ''; Add(ArrayID: string[], ID: string): string[] { ArrayID: string[] = ArrayID.push(ID); return ArrayID; }; }`
Error Text
'string' only refers to a type, but is being used as a value here. Line with x. Push returns a number, but i want a string array as returntype
Supporting Information
Solution:
Problem Code