can-string-to-any
Turns a string representation of a primitive type back into the associated primitive.
stringToAny(string)
Examines the provided string to see if it can be converted to a primitive type. Supported arguments are:
import stringToAny from "can-string-to-any";
stringToAny( "NaN" ); // -> NaN
stringToAny( "44.4" ); // -> 44.4
stringToAny( "false" ); // -> false
Parameters
- string
{String}
:A string to convert back to its primitive type.
Returns
{*}
:
The primitive representation of the provided string.