function getStringValue(value: any): string { return value.toString(); } console.log(getStringValue(19)); console.log(getStringValue(19.4890)); console.log(getStringValue('hello')); console.log(getStringValue(true)); //or String(var)