typescript make a type equal to another type but without undefined code example Example: angular type of string if(typeof myVariable === 'string'){ //do }