/proc/istype()
Usage:
istype(Val)
istype(Val, Type)
Val: An instantiated object
Type: A type or object. If this argument is not specified, it will use the inferred type of the first argument.
Returns:
num: 1 if Val is the same as, or a child type of, Type
var/mob/my_atom = new /obj(loc) // the variable is declared as a /mob, but we create an /obj
if(istype(my_atom))
    // this will not pass, as the inferred type is different from the actual type

if(istype(my_atom, /obj))
    // this will pass, as we are providing a second argument to test with, which matches the type

For testing paths, use ispath().