Skip to main content

🚀 In our NEW AI Bootcamp you'll build a working app in 28 days, no experience required. Free to all subscription levels.

Join the Treehouse affiliate program and earn 25% recurring commission! 🤑

✨ Earn college credits in Cybersecurity, JS, HTML, CSS and Python

  • Treehouse Logo
    • For Individuals
    • For Businesses
    • For Schools
    • For Libraries
    • For Military
    • All Courses
    • Tracks
    • AI Bootcamp
    • College Credit
    • Techdegree Bootcamps
    • Front End Development
    • Full Stack JavaScript
    • Code Adventures
    • Discord
    • Forum
    • Success Stories
    • Treehouse Links
    • 100 Days of Code
    • Explore
    • Career Toolbox
    • Free Treehouse Near Me
    • Affiliates
    • Blog
    • Support
    • About
    • Learn
    • Beginner's Guide to Coding
    • Data Analysis with SQL & Python
    • Front-End Web Development
    • Python Programming Basics
    • Techdegree Bootcamp Overview
    • UX Design Fundamentals
    • AI Tools for Beginners
  • For Individuals For Businesses For Schools For Libraries For Military
  • All Courses Tracks AI Bootcamp College Credit
  • Techdegree Bootcamps Front End Web Development Full Stack JavaScript
  • Code Adventures Discord Forum Success Stories Treehouse Links 100 Days of Code
  • Explore Career Toolbox Free Treehouse Near Me Affiliates Blog Support About
    Learn Beginner's Guide to Coding Data Analysis with SQL & Python Front-End Web Development Python Programming Basics Techdegree Bootcamp Overview UX Design Fundamentals AI Tools for Beginners
  • Sign In
  • Free Trial
Instagram Twitter Facebook YouTube LinkedIn
Loading banner... Start your free trial at Treehouse
    • Newest
      • Newest
      • Active
      • Unanswered
      • Featured
    • All Topics
      • All Topics
      • • General Discussion
      • • AI
      • • APIs
      • • Coding for Kids
      • • College Credit
      • • Computer Science
      • • CSS
      • • Data Analysis
      • • Databases
      • • Design
      • • Development Tools
      • • Digital Literacy
      • • Game Development
      • • Go Language
      • • HTML
      • • Java
      • • JavaScript
      • • Learning Resources
      • • Machine Learning
      • • No-Code
      • • PHP
      • • Professional Growth
      • • Python
      • • Quality Assurance
      • • React
      • • Ruby
      • • Security
      • • Swift
      • • Vibe Coding
  • Egor Bedunkevich
    Egor Bedunkevich
    643 Points

    Why do we need to assign a function that captures variables to a constant/variable for it to be a closure?

    Posted April 26, 2016 5:02am by Egor Bedunkevich
    Egor Bedunkevich
    643 Points
    • iOS
    • Swift Closures
    • Closures and Closure Expressions
    • Closure Expression Syntax

    0 Answers

  • Austin Hawks
    PLUS
    Austin Hawks
    Courses Plus Student 3,003 Points

    When I type it in xcode, the code works, and I'm doing what the question wants, but treehouse isn't letting me pass.

    Posted April 19, 2016 8:08pm by Austin Hawks
    Austin Hawks
    Courses Plus Student 3,003 Points
    • iOS
    • Swift Closures
    • Closures and Closure Expressions
    • Using Filter

    2 Answers

  • Cody Adkins
    Cody Adkins
    7,260 Points

    Help with my code

    Posted March 20, 2016 5:59pm by Cody Adkins
    Cody Adkins
    7,260 Points
    • iOS
    • Swift Closures
    • Closures and Closure Expressions
    • Using Filter

    2 Answers

  • NOUR A ALGHAMDI
    PLUS
    NOUR A ALGHAMDI
    Courses Plus Student 5,607 Points

    2nd challenge :( need your help

    Posted January 24, 2016 8:13pm by NOUR A ALGHAMDI
    NOUR A ALGHAMDI
    Courses Plus Student 5,607 Points
    • iOS
    • Swift Closures
    • Closures and Closure Expressions
    • Using Filter

    1 Answer

  • NOUR A ALGHAMDI
    PLUS
    NOUR A ALGHAMDI
    Courses Plus Student 5,607 Points

    please i need an explain and help :\

    Posted January 24, 2016 7:00pm by NOUR A ALGHAMDI
    NOUR A ALGHAMDI
    Courses Plus Student 5,607 Points
    • iOS
    • Swift Closures
    • Closures and Closure Expressions
    • Using the Sorted Function

    2 Answers

  • Pablo Caro
    Pablo Caro
    4,191 Points

    Can't get pass Step 1

    Posted January 12, 2016 2:15pm by Pablo Caro
    Pablo Caro
    4,191 Points
    • iOS
    • Swift Closures
    • Closures and Closure Expressions
    • Using Filter

    2 Answers

  • Benjamin Cooper
    Benjamin Cooper
    3,162 Points

    Why does the challenge not work in actual 2.0 swift?

    Posted January 12, 2016 3:08am by Benjamin Cooper
    Benjamin Cooper
    3,162 Points
    • iOS
    • Swift Closures
    • Closures and Closure Expressions
    • More Closure Shorthand

    3 Answers

  • villa
    villa
    6,171 Points

    Help i don't know what i doing wrong

    Posted December 5, 2015 1:57am by villa
    villa
    6,171 Points
    • iOS
    • Swift Closures
    • Closures and Closure Expressions
    • Using Filter

    0 Answers

  • Brendan Whiting
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    Brendan Whiting
    Front End Web Development Techdegree Graduate 84,740 Points

    What's the logic behind the keyword "in" in closure expression syntax?

    Posted December 3, 2015 8:26pm by Brendan Whiting
    .a{fill-rule:evenodd;}techdegree seal-36
    Brendan Whiting
    Front End Web Development Techdegree Graduate 84,740 Points
    • iOS
    • Swift Closures
    • Closures and Closure Expressions
    • Using the Sorted Function

    3 Answers

  • qasimalbaqali
    qasimalbaqali
    17,839 Points

    Using Filter challenge [Closuers]

    Posted October 30, 2015 2:53pm by qasimalbaqali
    qasimalbaqali
    17,839 Points
    • iOS
    • Swift Closures
    • Closures and Closure Expressions
    • Using Filter

    1 Answer

  • Antonija Pek
    Antonija Pek
    5,819 Points

    How bad did I miss the result?

    Posted September 5, 2015 4:18pm by Antonija Pek
    Antonija Pek
    5,819 Points
    • iOS
    • Swift Closures
    • Closures and Closure Expressions
    • Using Filter

    2 Answers

  • Bruce G
    Bruce G
    5,360 Points

    What is numbers for?

    Posted August 21, 2015 9:22am by Bruce G
    Bruce G
    5,360 Points
    • iOS
    • Swift Closures
    • Closures and Closure Expressions
    • Using Filter

    1 Answer

  • David Bauer
    David Bauer
    3,863 Points

    Using the Sorted Function gives an error

    Posted August 13, 2015 6:25pm by David Bauer
    David Bauer
    3,863 Points
    • iOS
    • Swift Closures
    • Closures and Closure Expressions
    • Using the Sorted Function

    2 Answers

  • kevin11
    kevin11
    2,535 Points

    Swift Closure Challenge?

    Posted July 20, 2015 1:47pm by kevin11
    kevin11
    2,535 Points
    • iOS
    • Swift Closures
    • Closures and Closure Expressions
    • Using Filter

    1 Answer

  • Jeremy Powell
    Jeremy Powell
    2,420 Points

    Swift Closures: Using Filter challenge task 1 of 2 is wrong how?

    Posted July 15, 2015 2:39am by Jeremy Powell
    Jeremy Powell
    2,420 Points
    • iOS
    • Swift Closures
    • Closures and Closure Expressions
    • Using Filter

    2 Answers

  • Will Matthews
    Will Matthews
    8,127 Points

    Why doesn't my isOdd function pass the test?

    Posted July 10, 2015 10:30am by Will Matthews
    Will Matthews
    8,127 Points
    • iOS
    • Swift Closures
    • Closures and Closure Expressions
    • Using Filter

    2 Answers

  • Roland Shen
    Roland Shen
    7,628 Points

    Why assign a function to a variable?

    Posted July 8, 2015 10:19pm by Roland Shen
    Roland Shen
    7,628 Points
    • iOS
    • Swift Closures
    • Closures and Closure Expressions
    • Closure Expression Syntax

    1 Answer

  • Zubeyr Aciksari
    Zubeyr Aciksari
    21,074 Points

    Define a function, named isOdd, to check if a number is odd. The function takes a number and returns either true or fals

    Posted June 14, 2015 6:58pm by Zubeyr Aciksari
    Zubeyr Aciksari
    21,074 Points
    • iOS
    • Swift Closures
    • Closures and Closure Expressions
    • Using Filter

    1 Answer

  • Matt Frerichs
    Matt Frerichs
    4,015 Points

    Need help creating oddNumbers array in closures challenge.

    Posted June 5, 2015 6:54pm by Matt Frerichs
    Matt Frerichs
    4,015 Points
    • iOS
    • Swift Closures
    • Closures and Closure Expressions
    • Using Filter

    3 Answers

  • Beth Knight
    Beth Knight
    4,244 Points

    Beating the odds

    Posted June 4, 2015 8:31pm by Beth Knight
    Beth Knight
    4,244 Points
    • iOS
    • Swift Closures
    • Closures and Closure Expressions
    • Using Filter

    2 Answers

Posting to the forum is only allowed for members with active accounts.
Please sign in or sign up to post.

Techdegree

  • Front End Web Development
  • Full Stack JavaScript
SEE ALL

Tracks

  • Learn to Code for Beginners
  • Beginning Python
  • Beginning SQL
  • Beginning Java
SEE ALL

Courses

  • JavaScript Basics
  • Intro to HTML & CSS
  • Python Basics
  • CSS Layout
SEE ALL

About Us

  • About
  • Blog
  • Community
  • Stories
  • Contact
  • Gift Card

Explore

  • Plans
  • Affiliates
  • Perks
  • Shop
  • Free Treehouse Near Me
  • Treehouse for Libraries
  • Treehouse for Businesses

Treehouse is an online technology education platform founded in 2011. Treehouse offers more than 700 self-paced, video-based courses in web development, programming, data analysis, design, and AI, plus two project-based bootcamp programs in Front End Web Development and Full Stack JavaScript. Individual Treehouse plans start at $25 per month and include a 7-day free trial. Treehouse serves individual learners, businesses, schools, and public libraries. Cardholders at participating U.S. public libraries can use Treehouse for free. Select Treehouse courses, offered with University Pathways International, are recommended for college credit by ACE and NCCRS. Treehouse learners earn digital certificates for completed Tracks.

Terms & Conditions · Privacy · © 2026 Treehouse Island, Inc.
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
  • Instagram
  • Discord