Enumeration I

The devs at Lighthouse Rock have received a shipment of Spearguns for use in the battle against the Really Awesome Pirates (RAP). They need to know quickly on their augmented reality eyeglasses just which spears have arrived (they can’t leave their posts at the bulbs). The Object for the shipping box is below:

var rockSpearguns = {
  Sharpshooter: {barbs: 2, weight: 10, heft: "overhand"},
  Pokepistol: {barbs: 4, weight: 8, heft: "shoulder"},
  Javelinjet: {barbs: 4, weight: 12, heft: "waist"},
  Firefork: {barbs: 6, weight: 8, heft: "overhand"},
  "The Impaler": {barbs: 1, weight: 30, heft: "chest"}
};
Build a declared function called listGuns that accepts a container of spearguns, called guns, as a parameter and logs out the name of each Speargun. Additionally, use speargun to refer to the property names inside your function. When your function is built, call it on the given shipment of guns.
Enumeration II

Great, so we’ve got our list of Spearguns.

Problem is, the ranger-devs need to know what heft each Speargun has in order to know which one is right for each of their individual aiming styles.

Modify your existing listGuns function to log out the following message for each Speargun contained with the shipping container:

Behold! <speargun name>, with <heft style> heft!
Additionally, use only bracket notation for accessing properties within your function. For efficiency of code, create NO new variables. You’ll still want to call the function at the end, so you can leave that line of code intact.
Enumeration III

Well, you probably know what’s coming. The ranger devs need your awesome function added directly to rockSpearguns, the list of the new Spearguns. Using your knowledge of enumeration and adding functions to JavaScript objects as properties, make your function a part of the rockSpearguns object variable. After you’ve added the function to the object, call the function using an appropriate syntax.

The former declared function is provided for you below. Remember: when you add this function to an object, as it is currently written, it will search through ALL properties of the object…including itself.

You’ll need to devise a way to ensure that only Spearguns get printed in the message for the ranger-devs. Since you’ll now be looking at more than just Spearguns within the rockSpearguns object, change your enumeration reference word to property instead of speargun, so that your code is more intuitive to someone reading it.

Just to add a tiny layer of toughness, the ranger-devs have asked that you use ONLY bracket notation throughout this challenge…no dots.

function listGuns (guns){
  for(var speargun in guns){
    console.log("Behold! " + speargun +
                ", with " + guns[speargun] +
                " heft!");
  }
}