words = _objectWrappers.wrap(_arrays.arrayOf(_plugins.loadClass("java.lang.String"), "hello", "world", "kotlin")) # 迭代数组元素及其索引 words.withIndex().forEach(lambda it: _console.log("Index: ", it.getIndex(), "Word: ", it.getValue())) # 输出: # Index: 0, Word: hello # Index: 1, Word: world # Index: 2, Word: kotlin