Skip to main content

Notice: Workspaces are undergoing maintenance and are temporarily unavailable.

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

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

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

  • 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
  • Samuel Kleos
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Samuel Kleos
    Front End Web Development Techdegree Student 13,728 Points

    Is this approach okay? #flatten #reduce #map

    Posted February 25, 2023 10:04am by Samuel Kleos
    .a{fill-rule:evenodd;}techdegree
    Samuel Kleos
    Front End Web Development Techdegree Student 13,728 Points
    • JavaScript
    • JavaScript Array Iteration Methods
    • Combining Array Methods
    • Nested Data and Additional Exploration

    1 Answer

  • Kade Rathbun
    Kade Rathbun
    6,586 Points

    Why is the initial value set to []?

    Posted August 2, 2022 7:33pm by Kade Rathbun
    Kade Rathbun
    6,586 Points
    • JavaScript
    • JavaScript Array Iteration Methods
    • Combining Array Methods
    • Nested Data and Additional Exploration

    1 Answer

  • Sam Bailey
    Sam Bailey
    8,425 Points

    Don't understand the first example

    Posted November 7, 2020 12:40pm by Sam Bailey
    Sam Bailey
    8,425 Points
    • JavaScript
    • JavaScript Array Iteration Methods
    • Combining Array Methods
    • Nested Data and Additional Exploration

    1 Answer

  • Joseph Michelini
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    Joseph Michelini
    Python Development Techdegree Graduate 18,692 Points

    Why does my code still work without providing the .reduce() method an initialValue?

    Posted June 9, 2020 7:54pm by Joseph Michelini
    .a{fill-rule:evenodd;}techdegree seal-36
    Joseph Michelini
    Python Development Techdegree Graduate 18,692 Points
    • JavaScript
    • JavaScript Array Iteration Methods
    • Combining Array Methods
    • Nested Data and Additional Exploration

    2 Answers

  • Begana Choi
    PLUS
    Begana Choi
    Courses Plus Student 13,126 Points

    what is the difference between those two codes?

    Posted March 20, 2020 1:23pm by Begana Choi
    Begana Choi
    Courses Plus Student 13,126 Points
    • JavaScript
    • JavaScript Array Iteration Methods
    • Combining Array Methods
    • Nested Data and Additional Exploration

    1 Answer

  • Begana Choi
    PLUS
    Begana Choi
    Courses Plus Student 13,126 Points

    why concat doesn't work with {}?

    Posted March 20, 2020 1:08pm by Begana Choi
    Begana Choi
    Courses Plus Student 13,126 Points
    • JavaScript
    • JavaScript Array Iteration Methods
    • Combining Array Methods
    • Nested Data and Additional Exploration

    1 Answer

  • <noob />
    <noob />
    17,063 Points

    a question about reduce with spread operator

    Posted January 3, 2020 1:52pm by <noob />
    <noob />
    17,063 Points
    • JavaScript
    • JavaScript Array Iteration Methods
    • Combining Array Methods
    • Nested Data and Additional Exploration

    1 Answer

  • vamosrope14
    vamosrope14
    14,932 Points

    Did we need to specify the default value of the accumulator to be equal to "[]"?

    Posted July 15, 2019 2:01am by vamosrope14
    vamosrope14
    14,932 Points
    • JavaScript
    • JavaScript Array Iteration Methods
    • Combining Array Methods
    • Nested Data and Additional Exploration

    1 Answer

  • vincenzo IEVA
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    vincenzo IEVA
    Front End Web Development Techdegree Graduate 14,211 Points

    spread operator in this case

    Posted July 14, 2019 2:33pm by vincenzo IEVA
    .a{fill-rule:evenodd;}techdegree seal-36
    vincenzo IEVA
    Front End Web Development Techdegree Graduate 14,211 Points
    • JavaScript
    • JavaScript Array Iteration Methods
    • Combining Array Methods
    • Nested Data and Additional Exploration

    1 Answer

  • Victor Ibasco
    Victor Ibasco
    11,035 Points

    He said, "call reduce() method on the array" and the syntax is '.array()'

    Posted May 6, 2019 7:28pm by Victor Ibasco
    Victor Ibasco
    11,035 Points
    • JavaScript
    • JavaScript Array Iteration Methods
    • Combining Array Methods
    • Nested Data and Additional Exploration

    1 Answer

  • yoav green
    yoav green
    8,611 Points

    why can we use .map() in the first example?

    Posted February 3, 2019 2:29pm by yoav green
    yoav green
    8,611 Points
    • JavaScript
    • JavaScript Array Iteration Methods
    • Combining Array Methods
    • Nested Data and Additional Exploration

    1 Answer

  • Peter Retvari
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Peter Retvari
    Full Stack JavaScript Techdegree Student 8,392 Points

    end of the ' JavaScript Array Iteration Methods' class the practice section doesn't work

    Posted August 29, 2018 2:37pm by Peter Retvari
    .a{fill-rule:evenodd;}techdegree
    Peter Retvari
    Full Stack JavaScript Techdegree Student 8,392 Points
    • JavaScript
    • JavaScript Array Iteration Methods
    • Combining Array Methods
    • Nested Data and Additional Exploration

    1 Answer

  • Peter Retvari
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Peter Retvari
    Full Stack JavaScript Techdegree Student 8,392 Points

    solution with forEach ?

    Posted August 29, 2018 2:23pm by Peter Retvari
    .a{fill-rule:evenodd;}techdegree
    Peter Retvari
    Full Stack JavaScript Techdegree Student 8,392 Points
    • JavaScript
    • JavaScript Array Iteration Methods
    • Combining Array Methods
    • Nested Data and Additional Exploration

    2 Answers

  • Michael Chambers
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    Michael Chambers
    Full Stack JavaScript Techdegree Graduate 28,393 Points

    Question about method chaining

    Posted April 27, 2018 11:46pm by Michael Chambers
    .a{fill-rule:evenodd;}techdegree seal-36
    Michael Chambers
    Full Stack JavaScript Techdegree Graduate 28,393 Points
    • JavaScript
    • JavaScript Array Iteration Methods
    • Combining Array Methods
    • Nested Data and Additional Exploration

    1 Answer

  • Sam Gord
    Sam Gord
    14,084 Points

    please check my answer to the first challenge, did it another way.

    Posted March 3, 2018 9:01am by Sam Gord
    Sam Gord
    14,084 Points
    • JavaScript
    • JavaScript Array Iteration Methods
    • Combining Array Methods
    • Nested Data and Additional Exploration

    1 Answer

  • Tony Brackins
    Tony Brackins
    28,766 Points

    Nested Data Challenge

    Posted December 12, 2017 5:14pm by Tony Brackins
    Tony Brackins
    28,766 Points
    • JavaScript
    • JavaScript Array Iteration Methods
    • Combining Array Methods
    • Nested Data and Additional Exploration

    1 Answer

  • Jordan Mor
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    Jordan Mor
    Full Stack JavaScript Techdegree Graduate 31,711 Points

    Is this a more effective solution to the second challenge in this lesson?

    Posted November 1, 2017 8:12pm by Jordan Mor
    .a{fill-rule:evenodd;}techdegree seal-36
    Jordan Mor
    Full Stack JavaScript Techdegree Graduate 31,711 Points
    • JavaScript
    • JavaScript Array Iteration Methods
    • Combining Array Methods
    • Nested Data and Additional Exploration

    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