mardi 7 juin 2016

Square brackets surrounding parameter in function definition

I came across the following code in the Ember CLI website:

export default Ember.Helper.helper(function([value]) {
  return value.toUpperCase();
});

What confuses me is the square brackets surrounding the value parameter. I can understand it in a function call, but why in function definition?




Aucun commentaire:

Enregistrer un commentaire