Check if weapon is in inventory script

Hi, I hope I'm posting this in the correct location!

So I'm still new to Javascript, but I'm trying to write a simple check to see if I have a weapon in my inventory. All I can find are things related to checking if I have the item actually equipped or not.

if ($gameActors.actor(1).equips().contains($dataWeapons[50])){ $gameVariables.setValue(271, 61);}else{ $gameVariables.setValue(271), 0);}That's the code that I have, and it works to check and see if I have the weapon in the 50th database slot for weapons is equipped, but that's not quite what I want. 

Is there a $gameActors.actor(1).inventory().contains(blahblah) that I can use? I've tried a few variations and I've looked through some of the .js files but I can't find anything. 🙁 Sorry if the answer to this is really obvious and I'm missing something simple. 

Edit: I want to check specifically for a weapon in my inventory, not an item. 
The inventory is not for one actor alone.

It's for the entire party, so look this:

Game_Party.prototype.weapons = function() { var list = []; for (var id in this._weapons) { list.push($dataWeapons[id]); } return list;};This function should give you a list of all weapons from your inventory.

Code:
$gameParty.weapons();
Fantastic! That's just what I was looking for. 🙂 Thank you very much!

Original thread: https://forums.rpgmakerweb.com/threads/check-if-weapon-is-in-inventory-script.53205/