typescript is string code example
Example 1: display true if the parameter is type string
if (typeof myVar === 'string' || myVar instanceof String)
// it's a string
else
// it's something else
Example 2: angular type of string
if(typeof myVariable === 'string'){
//do
}