Check out example codes for "scss loop". It will help you in understanding the concepts better.

Code Example 1

$base-color: #036;

@for $i from 1 through 3 {
  ul:nth-child(3n + #{$i}) {
    background-color: lighten($base-color, $i * 5%);
  }
}

Code Example 2

@for $i from 1 through 6 {
    .grid-#{$i} {
        width: 100px*$i;
    }
}

Code Example 3

@for $i from 1 through 3 {
  ul:nth-child(3n + #{$i}) {
    background-color: lighten($base-color, $i * 5%);
  }
}

Code Example 4

@each $theme-name, $theme-color in $colors-theme-bo {
  .theme-#{$theme-name} {
    color: $theme-color;
  }
}

Learn ReactJs, React Native from akashmittal.com