To the Lighthouse, Quick!

PIRATES AHOY! Despite protests of “I’m a coder, not a fighter”, it’s time for the ranger-devs to get over to the Lighthouse and throw down!

In the editor is a modified object literal for Lighthouse Rock, with the new blinders now showing up in a property. Additionally, a new property, numRangers, has been added to track how many rangers are fighting for the Ocean of Objects at the Lighthouse.

Your goal is to build a declared function that adds the following three rangers, in order and as complete objects, to the Lighthouse Rock object itself:

name: “Nick Walsh”, skillz: “magnification burn”, station: 2
name: “Drew Barontini”, skillz: “uppercut launch”, station: 3
name: “Christine Wong”, skillz: “bomb defusing”, station: 1
Each added ranger object should become its own property within lighthouseRock, specifically ranger1, ranger2, and ranger3. Additionally, as you add a ranger, increment the number of rangers present using the existing numRangers property.

In order to add your newly created objects to the Lighthouse, your function should accept a location parameter, which will represent an object. To help us check your function, order your function parameters as location, name, skillz, and station.

Name your new function addRanger. Lastly, when the function has been built, call it three times, with the appropriate data each time, to effectively add all three rangers to lighthouseRock.
Man your Bulb Stations, Doods!

This one’s a little tricky…think carefully. Now that we’ve got some man- and woman-power at the Lighthouse, we need to tell the ranger-devs which super-blinding bulb they are stationed at.

Build a function that takes in a location object, examines every ranger’s station number, and retrieves the name of the super-blinder to which they’re assigned from the array of the super-blinders. When the right super-blinder is found for a ranger-dev, alert it in a message to the ranger in the following format:

Avast, me hearties!
There be Pirates nearby! Stations!
<name>, man the <superblinder>!
<name>, man the <superblinder>!
<name>, man the <superblinder>!
In other words, the entire list of assignments should be contained within one alert. Hmm, sound familiar?

Call your function dontPanic, and when it is completed, call it on the lighthouseRock variable which is provided for you, complete with new ranger-dev objects as if they had been there from the get-go.