useful "escape hatch."  script  blocks of non-trivial size and/or complexity should be moved into Shared Libraries instead. Example // Declarative // pipeline { agent any stages { stage('Example') { steps { echo 'Hello World' script { def browsers = ['chrome', 'firefox'] for (int i = 0; i < browsers.size(); ++i) { echo "Testing the ${browsers[i]} browser" } } } } } } // Script // 100