This page deals with functions that have more than one parameter, and function
results that are arrays. The next page deals with checking single parameter
types, and single type function results.
The Person() function's signatures.
- Input : [ 'string', 'string', 'date' ] - three distinct parameters things conveyed by an array
- Output : [ 'number', 'string', 'string' ] - an actual result array
An error occurs because Alan Turing's birthdate is a number, 1912, not a Date().
And, Avicii has his last name deliberatly set to undefined, causing the Person()
return result to not match the correct signature.
Try-catches are used to limit the number of errors in the console.