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

🤑 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

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

  • 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
    • Showing results for:
    • JavaScript
    • Practice forEach in JavaScript
    • Close
  • Vanessa Shing
    Vanessa Shing
    7,462 Points

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

    Posted on May 16 by Vanessa Shing
    Vanessa Shing
    7,462 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 on Jul 2, 2023 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 on Nov 28, 2021 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 on Mar 31, 2021 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 on Dec 9, 2020 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 on Nov 27, 2020 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 on Apr 10, 2020 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 on Apr 10, 2020 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 on Mar 16, 2020 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 on Dec 18, 2019 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 on Dec 14, 2019 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 on Sep 5, 2019 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 on Jul 1, 2019 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 on May 29, 2019 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 on Apr 23, 2019 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 on Dec 8, 2018 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 on Aug 27, 2018 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 on Aug 16, 2018 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 on Mar 31, 2018 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 on Mar 9, 2018 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 on Jan 16, 2018 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 on Dec 17, 2017 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 on Nov 30, 2017 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 on Nov 25, 2017 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.