var n = 11;
this.getField("Text1").value = n;
var pad = String(n).padStart(3, '0');
this.getField("Text2").value = pad;
shouldn't the above produce: [in Text 1] 11, [in Text 2] 011? it does nothing for me.
上面不应该产生:[在文本1]11,[在文本2]011吗?这对我一点用处都没有。
and this:
还有这个:
this.getField("Text3").value = String(1).padStart(3, '0');
should produce: [in Text 3] 001? again, does nothing for me.
应产生:[在文本3中]001?再说一次,对我没有任何帮助。
why would the fields (Text 2 and Text 3) be blank for me?
为什么我的字段(文本2和文本3)为空?
更多回答
IIRC, Adobe products don't use JS, but extendscript, a subset of modern JS which is based on and locked at ES3 (1999). .padStart()
was, on the other hand, added in ES6 (2015)...
IIRC,Adobe产品不使用JS,而是使用扩展脚本,这是现代JS的一个子集,它基于并锁定在ES3(1999)上。另一方面,.padStart()是在ES6(2015)中添加的...
优秀答案推荐
我是一名优秀的程序员,十分优秀!