什么是 'double-dot' [例如。 5..toFixed()] 我在缩小的 js 中看到了吗?
What is the 'double-dot' [eg. 5..toFixed()] I see in minified js?
我正在做一个项目,我需要处理 javacsript 框架才能工作。我们有一个解析器可以读取它们,但是在带有 .. 的行上有错误,例如
1..toPrecision()
或
24..map(function(t){return 7..map(function(a){return e[a][t]})
好像没看懂“..”,我也看不懂。为什么这个 javascript 有效?单个数字的映射如何工作?最终有人会修复解析器,但我正在寻找一个关于如何编辑缩小的 .js 文件以使其工作的临时修复程序。有没有其他方法可以写类似 24..map() 的东西?
第一个.
是小数分隔符。 1.
是一个数字。
第二个 .
是对象 属性 访问器。 someNumber.toPrecision
是一个函数。
另一种写法是用更多的有效数字来写:
1.0.toPrecision()
情况有点好笑。数字可以有小数点后的值,对吧?
console.log(1.2345); // for example
嗯,也可以写一个小数点后面没有任何数字的数字。
console.log(5.);
所以第一个点是小数点。第二个是 属性 访问器。
console.log(5. .toString());
// ^ decimal point ^ property accessor
The specification 将十进制文字定义为:
DecimalIntegerLiteral . DecimalDigits opt ExponentPart opt
其中 opt 表示可选。
我正在做一个项目,我需要处理 javacsript 框架才能工作。我们有一个解析器可以读取它们,但是在带有 .. 的行上有错误,例如
1..toPrecision()
或
24..map(function(t){return 7..map(function(a){return e[a][t]})
好像没看懂“..”,我也看不懂。为什么这个 javascript 有效?单个数字的映射如何工作?最终有人会修复解析器,但我正在寻找一个关于如何编辑缩小的 .js 文件以使其工作的临时修复程序。有没有其他方法可以写类似 24..map() 的东西?
第一个.
是小数分隔符。 1.
是一个数字。
第二个 .
是对象 属性 访问器。 someNumber.toPrecision
是一个函数。
另一种写法是用更多的有效数字来写:
1.0.toPrecision()
情况有点好笑。数字可以有小数点后的值,对吧?
console.log(1.2345); // for example
嗯,也可以写一个小数点后面没有任何数字的数字。
console.log(5.);
所以第一个点是小数点。第二个是 属性 访问器。
console.log(5. .toString());
// ^ decimal point ^ property accessor
The specification 将十进制文字定义为:
DecimalIntegerLiteral . DecimalDigits opt ExponentPart opt
其中 opt 表示可选。