問題タブ [jenkins-scriptler]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
groovy - groovy でリストを転置
このリストを groovy スクリプトに転置したいと考えています。2つのリストがあります
result_name = ["API (例)","管理ポータル (例)","Component1","Component2",]
result_ids = ["3wrhs4vp3sp5","g2828br1gzw9","68pnwhltxcq0","fy8g2nvvdg15",]
list[0][0], list[1][1].... のような出力を期待しています。例:
私はこれを使用して試しています
def result = [[result_name], [result_ids]].transpose()
しかし、結果は次のとおりです。
結果: [[["API (例)","管理ポータル (例)","Component1","Component2",], ["3wrhs4vp3sp5","g2828br1gzw9","68pnwhltxcq0","fy8g2nvvdg15",]]]
編集:質問のサンプルコードを更新しました:
結果