November 2018
Beginner
502 pages
10h 22m
English
Overload signatures allow a function to be called with different signatures. This feature can be used nicely to streamline a set of functions that a library offers to consumers. Wouldn't it be nice for a library that contained condenseString public functions and condenseArray to be streamlined so that it just contained a single public condense function? We'll do just this in this section:
function condenseString(string: string): string { return string.split(" ").join("");}
function condenseArray(array: string[]): string[] { return array.map(item => item.split(" ").join(""));}
Read now
Unlock full access