Errors: Deprecated octal
信息
SyntaxError:
"0"-prefixed octal literals and octal escape sequences are deprecated;
for octal literals use the \"0o\" prefix instead错误类型
SyntaxError in strict mode only.
什么地方出了错?
八进制文字和八进制转义序列被弃用,并会抛出一个SyntaxError严格的模式。使用ECMAScript 2015及更高版本,标准化语法使用前导零,后跟小写或大写拉丁字母“O”(0o或0O)。
例子
“0” - 前缀八进制文字
"use strict";
03;
// SyntaxError: "0"-prefixed octal literals and octal escape sequences
// are deprecated八进制转义序列
"use strict";
"\251";
// SyntaxError: "0"-prefixed octal literals and octal escape sequences
// are deprecated有效的八进制数字
Use a leading zero followed by the letter "o" or "O":
0o3;对于八进制转义序列,您可以使用十六进制转义序列:
'\xA9';本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com

