I have 2 .ts files.
index_num_bin.ts:
******
let arr: number[] = [1, 2, 3, 4, 5, 6, -7];
const t = 10;
arr = arr.sort();
console.log(indexOfN(arr, t));
index_num_bin_recur.ts:
let arr: number[] = [1, 2, 3, 4, 5, 6, -7];
const t = 10;
arr = arr.sort();
console.log(indexOfN(arr, t));
The second one has nothing but the ending of the previous one yet. However, I see an error: error_image_1st_file and vice versa: error_image_2nd_file It says like these files are in fact in the one file and the variable is already declared in another file and these 2 files fully see all the global scope of each other. And the same error with these variables in these two files(.
I searched for some scope problems but I couldn't find the right answer.