# .cadoles-slide-title[Fonctions (1/5)] **Déclaration et invocation** ```js // Déclaration function myFunc() { return 'Hello from myFunc'; } var myFunc2 = function() { return 'Hello from myFunc2'; }; // Invocation myFunc(); // -> 'Hello from myFunc' myFunc2(); // -> 'Hello from myFunc2' ``` **Les arguments** Comme les variables, les arguments d'une fonction en Javascript ne sont pas typés, et leur nombre n'est pas fixe. ```js function myFunc(arg1, arg2) { console.log(arg1, arg2); } myFunc('foo', 'bar'); // -> affiche 'foo bar' dans la console; myFunc('foo', 'bar', 'baz'); // Pas d'erreur ```