Checking equipment types

So I am trying to make a simple conditional statement to check to see if a certain actor is equipped with the Equipment type "Shield". I can't seem to come up with what my script should be. Could I get some direction please?
$gameActors.actor(id).equips().some(function(equip) { return !!equip && equip.etypeId == 2; })


Just change the 'id' on $gameActors.actor(id) to be the id of the actor you are checking.
Wow. It works perfectly. Thank you.
I have a similar question, how could I modify that statement to check in the damage formula of an attack skill.  I wanted my damage formulas to be modified if the character has an open hand (visa vi DnD 3.5).

$gameActors.actor(id).equips().some(function(equip) { return !!equip && equip.etypeId == 2; })


Just change the 'id' on $gameActors.actor(id) to be the id of the actor you are checking.

Original thread: https://forums.rpgmakerweb.com/threads/checking-equipment-types.65947/