Snippets Collections
import jenkins.model.*

instance = Jenkins.getInstance()
globalNodeProperties = instance.getGlobalNodeProperties()

myParam = 'Not Set'

globalNodeProperties.each {
  envVars = it.getEnvVars()
  if (envVars.get('ENV_VAR_NAME') != null) {
    myParam = envVars.get('ENV_VAR_NAME');
  }
}


if (myParam) {
    // Assuming the environment variable is a comma-separated string like "option1,option2,option3"
    return myParam.split(',').collect{ it.trim() }
} else {
    return ["Environment variable not set or empty"]
}
const getMousePosition = (x, y) => ({
  x: x,
  y: y
});

//can be written as
const getMousePosition = (x, y) => ({ x, y });
const profileUpdate = (profileData) => {
  const { name, age, nationality, location } = profileData;

}
//This effectively destructures the object sent into the function. This can also be done in-place:

const profileUpdate = ({ name, age, nationality, location }) => {

}
//When profileData is passed to the above function, the values are destructured from the function parameter for use within the function.
star

Sat Feb 28 2026 10:33:56 GMT+0000 (Coordinated Universal Time)

#jenkins #build #parameter
star

Tue Jul 12 2022 09:37:40 GMT+0000 (Coordinated Universal Time) https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/es6/write-concise-object-literal-declarations-using-object-property-shorthand

#array #object #destructure #parameter #arrowfunction
star

Tue Jul 12 2022 09:23:55 GMT+0000 (Coordinated Universal Time) https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-pass-an-object-as-a-functions-parameters

#array #object #destructure #parameter #arrowfunction

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension