0
我遇到未定義變量錯誤的問題。這是我的代碼:Array()中的變量未定義
window.sys.Bash = {};
window.sys.Bash.version = "";
window.sys.Bash.version.major = 0;
window.sys.Bash.version.minor = 1;
window.sys.Bash.version.build = 1;
window.sys.Bash.version.release = "beta";
window.sys.Bash.printing = false;
window.sys.Bash.queue = Array();
window.sys.Bash.span = bash;
window.sys.Bash.span.input = input;
window.sys.Bash.version = ""
+ window.sys.Bash.version.major + "."
+ window.sys.Bash.version.minor + "."
+ Array(2-window.sys.Bash.version.build.toString().length+1).join('0')
+ window.sys.Bash.version.build + "-"
+ window.sys.Bash.version.release + " "
+ "(x86_64-" + window.sys.platform + ")";
delete bash; delete input;
我的Web控制檯說,那window.sys.Bash.version.build是未定義在這條線:
+ Array(2-window.sys.Bash.version.build.toString().length+1).join('0')
我從here複製的代碼,所以我不對此知之甚少,但它應該有效,嗯?
哦!謝謝!有用! :D 只需等待7分鐘,您的答案將被標記爲接受:) – m93a