Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/439.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript VS代码有假错误吗?_Javascript_Typescript_Visual Studio Code - Fatal编程技术网

Javascript VS代码有假错误吗?

Javascript VS代码有假错误吗?,javascript,typescript,visual-studio-code,Javascript,Typescript,Visual Studio Code,我使用Visual Studio代码编写代码,但在更改我的计算机窗口后,VSCode会出现如下错误: message: 'Property 'splice' does not exist on type '{}'.' 这是我的密码: storedImages = []; removeImageAtIndex(index: number) { this.storedImages.splice(index, 1); } 还有其他的假错误,我知道我的代码没有任何错误,因为我的项目在更改

我使用Visual Studio代码编写代码,但在更改我的计算机窗口后,VSCode会出现如下错误:

message: 'Property 'splice' does not exist on type '{}'.'
这是我的密码:

storedImages = [];
removeImageAtIndex(index: number) {
    this.storedImages.splice(index, 1);
  }
还有其他的假错误,我知道我的代码没有任何错误,因为我的项目在更改我的计算机窗口之前工作正常,但现在很多假错误。我认为问题在于VScode

Visual Studio代码属性:

Version 1.19.2
Commit 490ef761b76b3f3b3832eff7a588aac891e5fe80
Date 2018-01-10T15:55:03.538Z
Shell 1.7.9
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64

npm version: 6.4.1
node version: v10.15.3
java version: 1.7.0_80
javac version: 1.8.0_231

这是一个爱奥尼亚项目,请帮助我,谢谢。

我认为应该是
this.storedImages=[]
storedImages和this.storedImages可能是不同的值,
this
用于引用对象上下文,目前上下文与您提供的代码不清楚。`storedImages=['abcddd'];RemoveImageIndex(索引:number){console.log(this.storedImages)//请检查此值this.storedImages.splice(索引,1);}`