首页 > 解决方案 > 尝试在javascript中生成消息时由于某种原因在我的代码中解析错误

问题描述

我正在尝试生成一条随机消息,但不知何故在我的代码中有一个解析错误,它说 void 是未定义的,即使它不需要定义,它称之为未定义


var a =1
while(a=1){
function alert(message?: any): void}
i have tried using 
GetFileDump=alert(GetFile AnyMessage)
//but that does not work either
//plz tell me what to do

标签: javascriptvoid

解决方案


尝试

var a = 1;
while (a === 1) {   // a = 1 is not the same as a === 1
  alert("message");
  a = 0;
}

推荐阅读