mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-11-22 04:04:29 +03:00
[typescript/en] multiple types (#4803)
This commit is contained in:
parent
07b055e8f1
commit
69f7f5d856
@ -72,6 +72,11 @@ let f4 = (i: number) => { return i * i; }
|
||||
// keyword needed
|
||||
let f5 = (i: number) => i * i;
|
||||
|
||||
// Functions can accept more than one type
|
||||
function f6(i: string | number): void {
|
||||
console.log("The value was " + i);
|
||||
}
|
||||
|
||||
// Interfaces are structural, anything that has the properties is compliant with
|
||||
// the interface
|
||||
interface Person {
|
||||
|
Loading…
Reference in New Issue
Block a user