Join me in the 21 day lighthouse labs coding challenge!

That was an awesome decision

@Eldhose

Thanks! Notice sometimes you have to hit submit button multiple times to actually get it through.

1 Like

I had that issue with Challenge 2 just now. It was the wording of the challenge itself that threw me off. Specifically (but without spoilers) what it was really asking for vs what it was textually asking for. I feel like the description on that one needs to be tweaked.

I’ve found that to be true as well. I often times find myself in their little help forums if I hit a road block where people explain each step in detail.

Most times than not it ends up with a facepalm. I’m really making these challenges a lot harder than they need to be to be honest.

Also, thanks for all those that recently joined! Our group grew quite a bit over the past day or so

2 Likes

Hint of today’s challenge=>`availableModules is the array which is already defined. but we can not see them. We only need to find the count of property named essential stored in the array using for loop

How is today’s challenge. I haven’t found solution yet

To be honest i have had some trouble too: ends up some guessing was required ( at least i don’t remember to have received that info).
This is how i retrieved the index of life support, stored under module .name

availableModules.findIndex(mod => mod.name === "life-support");

Just join can we talk bit more in discord group ?

1 Like

const ship = { powerOn: false, modules: [], antenna: { active: false } }
const availableModules = [ { name: “shower”, size: 100, enabled : false, essential: true}, { name: “toaster”, size: 5, enabled : true, essential: false}, { name: “life-support”, size: 10, enabled : false, essential: false}, ];
this is how that two array looks like.
Now only i understood what we have to do to get today’s challenge paseed

1 we have to find property name which is equal to life-support from availableModules array.
then the property named enabled has value false, that should changed to true which is stored in the same index of name proprty which is equal to
life-support
then we have to push this array into ship.modules.push()
Am i right?

1 Like

Survived some how today also!.

Can somebody explain bit more about today challenge

We have two arrays. Name of first Array is ship and Name of second Array is
availableModules

const ship = { powerOn: false, modules: [], antenna: { active: false } }

This is the structure of ship array

const availableModules = [ { name: “shower”, size: 100, enabled : false, essential: true}, { name: “toaster”, size: 5, enabled : true, essential: false}, { name: “life-support”, size: 10, enabled : false, essential: false}, ];
This is how availableModules array looks like.

Actually what you have to do first to get the challege passed, you should find the index of the property name which has value life-support
{ name: “life-support”, size: 10, enabled : false, essential: false} this is that array.
Then you see the value of enabled is false . that you should change to true.
once you compleate this , then { name: “life-support”, size: 10, enabled : false, essential: false} should be pushed to ship’s property module. just ask if You did not understand

they specified that to call ‘powerOn()’ function we should update this value inside the function or What?
@Eldhose

which challenge are you taking about

very first challenge

I thought today’s challenge? can you just post that screen shot here
i don’t remember. I can’t see that also. but if I am right

there is a array ship which has a property named module.
const ship={module:false}(you cant see this array. it is already defined)
what you have to do is, when that function powerOn is invoked, the value of this
ship={module:true}

var i=0
function somename(){
i=1
return i
}
somename()
a small example
which is equal to 1 for first challenge

why this doesn’t work

No need of using if statement
power on when the value of ship’s module true
if it is off, power of.

you dont have to mention power off and on in your code. it is just 4 or five line code

the example i mentioned above where i have not used if statement , when function is invoked, all the value declare within the function call will change accordingly and there is no need of declaring the variable powerstate.
you play with ship.module= false which you have to convert to true when function is invoked