Cannot read property '1' of null


#1



https://www.codecademy.com/courses/learn-sass/lessons/functions-and-operations/exercises/for-loops?action=lesson_resume&link_content_target=interstitial_lesson


Cannot read property '1' of null


Replace this line with your code. 

$total: 10; //Number of .ray divs in our html
$step: 360deg / $total; //Used to compute the hue based on color-wheel


.ray {
  height: 30px;
}



for $i from 1 through 10 {
  .ray:nth-child(1) {
    background: blue;
   }
}


#2

Did you mean .ray:nth-child($i) { ?


#3

No, it on first line of the loop.

for $i from 1 through $total {
.ray:nth-child(#{$i}) {
background: blue;
}
}


#4

my mistake, I forgot $ before "for"


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.