/typescript/

TypeScript part 9 (function arguments)

2017-03-04 12:36:02

TypeScript

function sayLorem(): void {
    console.log("Lorem");
}

function multiply(val1: number, val2: number): number {
    return val1 * val2;
}

function connect(val1: string, val2: number): string {
    return val1 + val2;
}

sayLorem();
console.log(multiply(5, 5));
console.log(connect("Lorem ", 25));

JavaScript

function sayLorem() {
    console.log("Lorem");
}
function multiply(val1, val2) {
    return val1 * val2;
}
function connect(val1, val2) {
    return val1 + val2;
}
sayLorem();
console.log(multiply(5, 5));
console.log(connect("Lorem ", 25));