Use JOY.type method to replace the method typeof.