I use VS and write Typescript
I would like simply to type the command "document.write" without having an error code. what I having now is an error code of this commmand "document". I just don't want to get into something complecated as there can be a simple solution ( I didn't experience this problem on my previous PC and VS).
Error message:
Error TS2584 (TS) Cannot find name 'document'. Do you need to change your target library? Try changing the lib
compiler option to include 'dom'. C:\web development\studies\typescript\replaceCharsInArray\replaceCharsInArray (tsconfig or jsconfig project) C:\web development\studies\typescript\replaceCharsInArray\replaceCharsInArray\app.ts 9 Active
let arr: string[] = ['black ofram','american walnut'];
function replaceCharsInStringArray(arr: string[], oldChar:string, newChar:string): string[] {
for (let i = 0; i >= arr.length - 1, i++;) {
arr[i] = arr[i].replace(newChar, oldChar);
return arr;
};
}
arr = replaceCharsInStringArray(arr, ' ', '_');
document.write