wrap($arrays->arrayOf($plugins->loadClass("java.lang.String"), "hello", "world", "kotlin")); // 将每个单词转换为带索引的字符串, 带索引的单词: [0: hello, 1: world, 2: kotlin] $words->mapIndexed(function ($index, $word) { return $index . ": " . $word; })->forEach(function ($it) use ($console) { $console->log($it); });