How to know if a target is an enemy or ally?

I am trying to build an achievement system and I want to give a reward if the player reaches a 9999 damage in a single action.

to get the damage done I use this function:
Code:
var _Game_Damage_Done = Game_Action.prototype.executeHpDamage;
    Game_Action.prototype.executeHpDamage = function(target, value) {
        _Game_Damage_Done.call(this, target, value);
        console.log(value);
    };

The problem is this function give me any damage done by the party or by the troop.

I wanted try finding if target is enemy using javascript find function():
Code:
        if(this._enemy.find(target)){
            console.log(value + " to enemy");
        }else{
            console.log(value + " to ally");
        }

But it throws an error.

How to know if a target is an enemy or ally?
Game_Battler has two functions for this: isActor() and isEnemy().
Thank you! it works!
Code:
        if(target.isEnemy()){
            console.log(value + " to enemy");
        }else{
            console.log(value + " to ally");
        }

Original thread: https://forums.rpgmakerweb.com/threads/how-to-know-if-a-target-is-an-enemy-or-ally.112574/