在environment.ts文件中
declare global {
interface String {
test(c: number): string;
}
interface Array<T> {
test(c: number): string;
}
interface Array<T> {
every2(callbackfn: any, thisArg: any);
}
}
String.prototype.test = function (c: number) {
return "abc";
}
Array.prototype.test = function (c: number) {
return "123";
}