Dirk Harriman Banner Image

 

Narrowing


function padLeft(padding: number | string, input: string): string { throw new Error("Not implemented yet!"); }
function padLeft(padding: number | string, input: string) { if (typeof padding === "number") { return " ".repeat(padding) + input; } return padding + input; }