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

New No-Code Track! 🚀start learning today!

🌟 Dreaming of a bright future? 🎓 Ask about the Treehouse Scholarship program! 🚀

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

  • Treehouse Logo
  • Plans
    Chevron
    • For Individuals
    • For Businesses
    • For Schools
    • For Libraries
    • For Military
  • Library
    Chevron
    • All Courses
    • Tracks
    • College Credit
  • Techdegree
    Chevron
    • Overview
    • Front End Development
    • Full Stack JavaScript
    • Data Analysis
    • UX Design
    • Python
  • Community
    Chevron
    • Code Adventures
    • Discord
    • Forum
    • Success Stories
    • Treehouse Links
    • 100 Days of Code
  • Resources
    Chevron
    • Career Toolbox
    • CodeForward
    • Free Treehouse Near Me
    • Jobs
    • Blog
    • Support
    • About
  • For Individuals For Businesses For Schools For Libraries For Military
  • All Courses Tracks College Credit
  • Overview Front End Web Development Full Stack JavaScript Python Development Data Analysis UX Design
  • Code Adventures Discord Forum Success Stories Treehouse Links 100 Days of Code
  • Career Toolbox CodeForward Free Treehouse Near Me Jobs Blog Support About
  • Sign In
  • Free Trial
Instagram Twitter Facebook YouTube LinkedIn
    • Newest
      • Newest
      • Active
      • Unanswered
      • Featured
    • All Topics
      • All Topics
      • • General Discussion
      • • AI
      • • Android
      • • 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
  • Vanessa Shing
    Vanessa Shing
    7,345 Points

    Not sure why the program isn't accepting since when the work is checked, the output array looks correct

    Posted May 16, 2025 2:18pm by Vanessa Shing
    Vanessa Shing
    7,345 Points
    • JavaScript
    • Practice forEach in JavaScript
    • Practice forEach
    • forEach Practice - 7

    1 Answer

  • Melissa Benton
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    Melissa Benton
    Front End Web Development Techdegree Graduate 17,805 Points

    How to add elements together using forEach

    Posted July 2, 2023 3:56pm by Melissa Benton
    .a{fill-rule:evenodd;}techdegree seal-36
    Melissa Benton
    Front End Web Development Techdegree Graduate 17,805 Points
    • JavaScript
    • Practice forEach in JavaScript
    • Practice forEach
    • forEach Practice - 1

    1 Answer

  • Victor Stanciu
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Victor Stanciu
    Full Stack JavaScript Techdegree Student 11,196 Points

    How could this be written using the ternary operator?

    Posted November 28, 2021 12:36pm by Victor Stanciu
    .a{fill-rule:evenodd;}techdegree
    Victor Stanciu
    Full Stack JavaScript Techdegree Student 11,196 Points
    • JavaScript
    • Practice forEach in JavaScript
    • Practice forEach
    • Challenge 5 Solution

    2 Answers

  • juliaels
    juliaels
    10,577 Points

    Why do we use push() method?

    Posted March 31, 2021 12:39am by juliaels
    juliaels
    10,577 Points
    • JavaScript
    • Practice forEach in JavaScript
    • Practice forEach
    • Challenge 2 Solution

    1 Answer

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

    Why doesn't this work?

    Posted December 9, 2020 10:06am by Taylor Hall
    .a{fill-rule:evenodd;}techdegree seal-36
    Taylor Hall
    Front End Web Development Techdegree Graduate 14,496 Points
    • JavaScript
    • Practice forEach in JavaScript
    • Practice forEach
    • forEach Practice - 2

    1 Answer

  • Eric Peppler
    Eric Peppler
    3,675 Points

    Bug?

    Posted November 27, 2020 3:13am by Eric Peppler
    Eric Peppler
    3,675 Points
    • JavaScript
    • Practice forEach in JavaScript
    • Practice forEach
    • forEach Practice - 2

    1 Answer

  • Hamzah Iqbal
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Hamzah Iqbal
    Full Stack JavaScript Techdegree Student 11,145 Points

    Dont I need to use character.value instead ?

    Posted April 10, 2020 10:17am by Hamzah Iqbal
    .a{fill-rule:evenodd;}techdegree
    Hamzah Iqbal
    Full Stack JavaScript Techdegree Student 11,145 Points
    • JavaScript
    • Practice forEach in JavaScript
    • Practice forEach
    • Challenge 4 Solution

    2 Answers

  • Hamzah Iqbal
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Hamzah Iqbal
    Full Stack JavaScript Techdegree Student 11,145 Points

    Why is it that the first Element is returned in forEach loop?

    Posted April 10, 2020 9:42am by Hamzah Iqbal
    .a{fill-rule:evenodd;}techdegree
    Hamzah Iqbal
    Full Stack JavaScript Techdegree Student 11,145 Points
    • JavaScript
    • Practice forEach in JavaScript
    • Practice forEach
    • forEach Practice - 2

    1 Answer

  • Tadjiev Codes
    Tadjiev Codes
    9,626 Points

    Using forEach, turn the number strings from the stringPrices array into floats and add them all, storing the total in th

    Posted March 16, 2020 2:12am by Tadjiev Codes
    Tadjiev Codes
    9,626 Points
    • JavaScript
    • Practice forEach in JavaScript
    • Practice forEach
    • forEach Practice - 3

    2 Answers

  • Piotr Manczak
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    Piotr Manczak
    Front End Web Development Techdegree Graduate 29,609 Points

    Array method on the string.

    Posted December 18, 2019 8:40am by Piotr Manczak
    .a{fill-rule:evenodd;}techdegree seal-36
    Piotr Manczak
    Front End Web Development Techdegree Graduate 29,609 Points
    • JavaScript
    • Practice forEach in JavaScript
    • Practice forEach
    • Challenge 6 Solution

    2 Answers

  • Seokhyun Wie
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    Seokhyun Wie
    Full Stack JavaScript Techdegree Graduate 21,606 Points

    My answer is right, but it is not accepted as an answer.

    Posted December 14, 2019 2:28pm by Seokhyun Wie
    .a{fill-rule:evenodd;}techdegree seal-36
    Seokhyun Wie
    Full Stack JavaScript Techdegree Graduate 21,606 Points
    • JavaScript
    • Practice forEach in JavaScript
    • Practice forEach
    • forEach Practice - 2

    1 Answer

  • Nick B.
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    Nick B.
    Full Stack JavaScript Techdegree Graduate 31,101 Points

    The split method turns a string into an array. In the case of alphabet below, each letter of the string is being turned

    Posted September 5, 2019 11:14am by Nick B.
    .a{fill-rule:evenodd;}techdegree seal-36
    Nick B.
    Full Stack JavaScript Techdegree Graduate 31,101 Points
    • JavaScript
    • Practice forEach in JavaScript
    • Practice forEach
    • forEach Practice - 4

    4 Answers

  • Dionte Barnes
    Dionte Barnes
    10,140 Points

    Using forEach, iterate over the colors array and store the hex colors that start with the letter F (ex. #FF0000) in the

    Posted July 1, 2019 4:57pm by Dionte Barnes
    Dionte Barnes
    10,140 Points
    • JavaScript
    • Practice forEach in JavaScript
    • Practice forEach
    • forEach Practice - 6

    2 Answers

  • Will Hunting
    Will Hunting
    13,726 Points

    Why is my code not being accepted ?

    Posted May 29, 2019 9:21pm by Will Hunting
    Will Hunting
    13,726 Points
    • JavaScript
    • Practice forEach in JavaScript
    • Practice forEach
    • forEach Practice - 2

    4 Answers

  • Derrick Drake
    Derrick Drake
    9,870 Points

    For the first challenge I used numbers instead of number and it still worked, whats the difference?

    Posted April 23, 2019 4:23pm by Derrick Drake
    Derrick Drake
    9,870 Points
    • JavaScript
    • Practice forEach in JavaScript
    • Practice forEach
    • Challenge 1 Solution

    1 Answer

  • Yannis Bouacida
    Yannis Bouacida
    9,169 Points

    The split method turns a string into an array. In the case of alphabet below, each letter of the string is being turned

    Posted December 8, 2018 12:44pm by Yannis Bouacida
    Yannis Bouacida
    9,169 Points
    • JavaScript
    • Practice forEach in JavaScript
    • Practice forEach
    • forEach Practice - 4

    1 Answer

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

    Code challenge doesn't accept my code

    Posted August 27, 2018 4:02pm by Peter Retvari
    .a{fill-rule:evenodd;}techdegree
    Peter Retvari
    Full Stack JavaScript Techdegree Student 8,392 Points
    • JavaScript
    • Practice forEach in JavaScript
    • Practice forEach
    • forEach Practice - 2

    4 Answers

  • fc3
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    fc3
    Python Web Development Techdegree Student 9,205 Points

    Extra parenthesis at the end of the video.

    Posted August 16, 2018 3:01pm by fc3
    .a{fill-rule:evenodd;}techdegree
    fc3
    Python Web Development Techdegree Student 9,205 Points
    • JavaScript
    • Practice forEach in JavaScript
    • Practice forEach
    • Challenge 2 Solution

    4 Answers

  • Katherine Pangtay
    Katherine Pangtay
    1,933 Points

    forEach

    Posted March 31, 2018 10:00pm by Katherine Pangtay
    Katherine Pangtay
    1,933 Points
    • JavaScript
    • Practice forEach in JavaScript
    • Practice forEach
    • forEach Practice - 1

    2 Answers

  • oafwifkeiw
    oafwifkeiw
    1,546 Points

    I think this code should be accepted

    Posted March 9, 2018 9:13pm by oafwifkeiw
    oafwifkeiw
    1,546 Points
    • JavaScript
    • Practice forEach in JavaScript
    • Practice forEach
    • forEach Practice - 4

    1 Answer

  • Zach Freitag
    Zach Freitag
    20,341 Points

    Using forEach, copy only the first 2 characters of each string in the days array and store the abbreviations in the dayA

    Posted January 16, 2018 9:06pm by Zach Freitag
    Zach Freitag
    20,341 Points
    • JavaScript
    • Practice forEach in JavaScript
    • Practice forEach
    • forEach Practice - 2

    2 Answers

  • robertmills2
    PLUS
    robertmills2
    Courses Plus Student 14,965 Points

    Deprecation and warning in the MDN

    Posted December 17, 2017 6:12am by robertmills2
    robertmills2
    Courses Plus Student 14,965 Points
    • JavaScript
    • Practice forEach in JavaScript
    • Practice forEach
    • forEach Practice - 1

    2 Answers

  • Gloria Cho
    PLUS
    Gloria Cho
    Courses Plus Student 278 Points

    Why does this forEach code cause weird repeat and format of answer?

    Posted November 30, 2017 11:20pm by Gloria Cho
    Gloria Cho
    Courses Plus Student 278 Points
    • JavaScript
    • Practice forEach in JavaScript
    • Practice forEach
    • forEach Practice - 7

    1 Answer

  • Jonathan Grieve
    MOD
    Jonathan Grieve
    Treehouse Moderator 91,254 Points

    Questions about Practice 6 for forEach loops

    Posted November 25, 2017 8:28pm by Jonathan Grieve
    Jonathan Grieve
    Treehouse Moderator 91,254 Points
    • JavaScript
    • Practice forEach in JavaScript
    • Practice forEach
    • forEach Practice - 6

    1 Answer

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

    Treehouse

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

See Full Catalogue

Techdegree

  • Front End Web Development
  • Full Stack JavaScript
  • Python Development
  • Data Analysis
  • UX Design

Tracks

  • Learn to Code for Beginners
  • Beginning Python
  • Beginning SQL
  • Beginning Java
  • ...see more

Courses

  • JavaScript Basics
  • Intro to HTML & CSS
  • Python Basics
  • CSS Layout
  • ...see more

Explore

  • Plans
  • Affiliates
  • Perks
  • Free Treehouse Near Me
  • Treehouse for Libraries
  • Treehouse for Businesses
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
  • Instagram
Terms & Conditions | Privacy

© 2025 Treehouse Island, Inc.