Skip to content

Instantly share code, notes, and snippets.

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 rahulmalhotra/f27c35f011404b63a9c50f8e69a12943 to your computer and use it in GitHub Desktop.
Save rahulmalhotra/f27c35f011404b63a9c50f8e69a12943 to your computer and use it in GitHub Desktop.
This code snippet is used in Default Parameters in ES6 JavaScript Tutorial for SFDC Stop
function add(a, b) {
b = b ? b : 2;
console.log(a+b);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment