Each Loops - Cannot Read Property '1' of Null


#1



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


Cannot Read Property '1' of Null. The 'Get Code' option doesn't work either and I'm stuck on this page now. I've tried 2 options as mentioned on another thread for the same problem, but it still doesn't work for me.


$list: (orange, purple, teal);
@each $item in $list {
  .#{item} {
    background: $item;
  }
}


$list: (orange, purple, teal);
@each $item in $list {
  $. (.#{item}) {
    background: $item;
  }
}


#2

invalid syntax, have a second look at what they want you to write in your loop


#3

Thanks for your reply @ionatan. did you mean the first or the second? as in, without the $. () or with it?


#4

Nvm, just realised the issue, silly me! Thanks again :slight_smile:


#5

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