7. For Loops Question. What does #{$i} mean?


#1



https://www.codecademy.com/en/courses/learn-sass/lessons/functions-and-operations/exercises/for-loops

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

Why there are the number sign(#) and curly braces( { } ) around the $i variable index? What are they doing there?
Can someone please explain it to me? Thanks in advance Codeacademy Schoolmates! ^_^


Replace this line with your code.


#2

@coursepro67740,
From
http://sass-lang.com/documentation/file.SASS_REFERENCE.html
we choose
http://sass-lang.com/documentation/file.SASS_REFERENCE.html#interpolation_
and
http://sass-lang.com/documentation/file.SASS_REFERENCE.html#_10

== discussion / opinion ==
http://stackoverflow.com/questions/24885582/what-does-hash-sign-do-outside-loops-in-sass


#3

Oh, string/char/text interpolation it is. Thanks for reminding, sir! ^_^


#4

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