Skip to content

Instantly share code, notes, and snippets.

@nikgraf
Last active December 10, 2015 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikgraf/37f3ec9288357c0e0e80 to your computer and use it in GitHub Desktop.
Save nikgraf/37f3ec9288357c0e0e80 to your computer and use it in GitHub Desktop.
I'm a big fan of the destructuring assignment syntax in combination with setting default values in JavaScript ❤️
export default ({options = {}}) => {
const {
min = Number.MAX_SAFE_INTEGER,
max = Number.MIN_SAFE_INTEGER,
step = 1,
} = options;
return `Range between ${min} and ${max} with a step of ${step}`;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment