Funzione freccia dattiloscritto

Esempi di codice

5
0

funzione freccia dattiloscritto

let sum = (x: number, y: number): number => {
    return x + y;
}

sum(10, 20); //returns 30
4
0

funzione freccia in dattiloscritto

//prototype 
const/let <FunctionName> = (params: type) :<ReturnType> =>{
  ....
};

const PrintName =  (name: string): string => {
  return console.log("my name is " , name) ;
}
3
0

generic arrow function typescript

const foo = <T extends unknown>(x: T) => x;
1
0

funzione freccia in ts

// ES6: With arrow function  
var getResult = (username: string, points: number): string => {  
  return `${ username } scored ${ points } points!`;  
};

getResult('joyous jackal' , 100);

Pagine correlate

Pagine di esempio simili

In altre lingue

Questa pagina è in altre lingue

Русский
..................................................................................................................
English
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................