Skip to content

Instantly share code, notes, and snippets.

@pauldub
Last active December 16, 2015 05:19
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 pauldub/5383113 to your computer and use it in GitHub Desktop.
Save pauldub/5383113 to your computer and use it in GitHub Desktop.
Dart's =>
var fruits = [
'banane',
'mangue',
'orange'
];
// L'operateur => c'est un shorthand pour les fonction de ce genre la si on l'appliquait a du JS
_.filter(fruits, function (fruit) {
return fruit.match(/^b/)
});
// La meme en utilisant =>
_.filter(fruits, (fruit) => fruit.match(/^b/));
// On peut ecrire avec cette syntaxe les fonctions anonymes d'une ligne, le return est induit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment