Welcome to the Linux Foundation Forum!

ch-7/labs-1

Posts: 1
edited April 2021 in LFW212 Class Forum

Hello everyone, I'm trying to make a code to pass in the labs-1 from chapter 7, but in the given code from the package, we have something like that:

service code

Ok if we assume somehtings like that:
var brands = [ 'Boston Whaler','Chaparral','Grady-White','Lund','MasterCraft','Sea Ray' ] ( length = 6 ), when id is equal to 1 the output of the given code will be undefined because the 1 - 231 evaluates to a number that is less than 0 and the modulus of (-230 % brands.length) is -2, when node evaluates brands[-2] it awlays returns an undefined value.

Does this code is correct or am I missed something?

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Comments

This discussion has been closed.

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training