TypeScript – Returning a Function
Functions may also return value along with control, back to the caller. Such functions are called returning functions. Syntax function function_name():return_type { //statements return value; } The return_type can be…