Une collection organisée de snippets de code pour accélérer votre développement. Parcourez, recherchez et copiez en un clic.
let maFonction: (a: number, b: number) => number;
function addition(a: number, b: number) {
return a + b;
}
function addition(a: number, b: number): number {
return a + b;
}
const multiplier = (a: number, b: number): number => a * b;
function construireNom(prenom: string, nom?: string) {
// ...
}
function construireNom(prenom: string, nom = "Smith") {
// ...
}
function construireNom(prenom: string, ...autresNoms: string[]) {
return prenom + " " + autresNoms.join(" ");
}