Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Kotlin for Java Developers Hello Kotlin! Compacting the Deck

jide delano
seal-mask
.a{fill-rule:evenodd;}techdegree
jide delano
Python Development Techdegree Student 14,220 Points

I get an warning "Lambda arguments should be moved outside of parenthesis"

I am getting a warning from IntelliJ with this line of code

val cards: Array<Card> = Array(52, { Card(it % 13, getSuit(it)) })

which is the same code from the lesson; however when I removed the parenthesis at the end

  val cards: Array<Card> = Array(52) { Card(it % 13, getSuit(it)) }

The warning went away, just curious as to why the warning is popping up or why Ben used the parenthesis in his example.

Thanks!