gpt4 book ai didi

javascript - After Effects 脚本编辑器的控制台仅记录 for 循环中的最后一个对象

转载 作者:行者123 更新时间:2023-12-02 03:45:52 25 4
gpt4 key购买 nike

我有以下 for 循环:

var arr = [ "a", "b", "c" ];
for(var i=0; i < arr.length; i++) {
arr[i];
}

当我在 After Effects CC 2014 的脚本编辑器中调用它时,控制台中只会打印 c 而不是:

a
b
c

只打印 Array 的最后一个对象,这正常吗?后台发生了什么?循环正常运行,如 a 然后 b 然后 c 并且仅打印最后一个对象只是脚本编辑器的一个选项?

最佳答案

Is this normal that only the last object of the Array is printed?

是的,这是 ExtendScript Toolkit (ESTK) 的正常行为,

What happens in the background?

我循环遍历你的数组。

The loop runs normally like a then b then c and printing the last object only is just an option of the Script Editor?

是的。再次。

如果你想打印出你需要使用$.write()$.writeln()的内容。这将在 ESTK 控制台中可见。您可以在 ESTK 中的“Help>Javacript Tools Guide CC”下找到有关 $ 辅助对象的更多信息。

关于javascript - After Effects 脚本编辑器的控制台仅记录 for 循环中的最后一个对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46779485/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com