Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

react typescript convert any to string

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)
Source by www.codevscolor.com #
 
PREVIOUS NEXT
Tagged: #react #typescript #convert #string
ADD COMMENT
Topic
Name
7+1 =