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

New No-Code Track! 🚀 New videos dropping every week—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
    • Community Projects
    • Live Sessions
    • 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
  • Community Projects Live Sessions 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
  • Alpha DIALLO
    Alpha DIALLO
    2,320 Points

    redundant code solution

    Posted September 23, 2024 11:40am by Alpha DIALLO
    Alpha DIALLO
    2,320 Points
    • JavaScript
    • JavaScript Loops
    • Working with 'for' Loops
    • Refactor Code with a Loop

    2 Answers

  • S M Tasfiqul Asif
    S M Tasfiqul Asif
    11,514 Points

    Can someone please tell me why am I getting an error?

    Posted August 5, 2023 9:01am by S M Tasfiqul Asif
    S M Tasfiqul Asif
    11,514 Points
    • JavaScript
    • JavaScript Loops
    • Working with 'for' Loops
    • Refactor Code with a Loop

    2 Answers

  • zkb
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    zkb
    Front End Web Development Techdegree Graduate 13,636 Points

    Why isn't my code logging the even numbers 2 through 24 to the console?

    Posted August 29, 2022 8:22am by zkb
    .a{fill-rule:evenodd;}techdegree seal-36
    zkb
    Front End Web Development Techdegree Graduate 13,636 Points
    • JavaScript
    • JavaScript Loops
    • Working with 'for' Loops
    • Refactor Code with a Loop

    1 Answer

  • Christopher tufano
    Christopher tufano
    1,686 Points

    for (i = 2; i <= 24; i += 2) { console.log(i); }// yeah, its not saying complete

    Posted June 5, 2022 2:01pm by Christopher tufano
    Christopher tufano
    1,686 Points
    • JavaScript
    • JavaScript Loops
    • Working with 'for' Loops
    • Refactor Code with a Loop

    1 Answer

  • Dominic Lorenz
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Dominic Lorenz
    Front End Web Development Techdegree Student 1,928 Points

    Error - your code should console.log once? Please help.

    Posted May 24, 2022 9:41pm by Dominic Lorenz
    .a{fill-rule:evenodd;}techdegree
    Dominic Lorenz
    Front End Web Development Techdegree Student 1,928 Points
    • JavaScript
    • JavaScript Loops
    • Working with 'for' Loops
    • Refactor Code with a Loop

    1 Answer

  • Clinton Vaught
    Clinton Vaught
    3,071 Points

    for ( i = 2; i <= 24; i += 2) { console.log(i); }

    Posted March 10, 2022 2:32am by Clinton Vaught
    Clinton Vaught
    3,071 Points
    • JavaScript
    • JavaScript Loops
    • Working with 'for' Loops
    • Refactor Code with a Loop

    1 Answer

  • Shaunty McMillin
    Shaunty McMillin
    5,379 Points

    Javascript loop code challenge seems to be malfunctioning

    Posted January 18, 2022 4:54pm by Shaunty McMillin
    Shaunty McMillin
    5,379 Points
    • JavaScript
    • JavaScript Loops
    • Working with 'for' Loops
    • Refactor Code with a Loop

    1 Answer

  • Nathalie Mukuna
    Nathalie Mukuna
    2,617 Points

    The code in script.js logs all even numbers (from 2 to 24) to the JavaScript console. There seems to be a lot of redunda

    Posted December 3, 2021 5:24pm by Nathalie Mukuna
    Nathalie Mukuna
    2,617 Points
    • JavaScript
    • JavaScript Loops
    • Working with 'for' Loops
    • Refactor Code with a Loop

    1 Answer

  • Angel Burgess
    Angel Burgess
    3,007 Points

    for (let i = 2; i <=24; i+= 2) { console.log(`${i}`); } the challenge keeps telling me "bummer: the console didnt

    Posted August 26, 2021 5:00pm by Angel Burgess
    Angel Burgess
    3,007 Points
    • JavaScript
    • JavaScript Loops
    • Working with 'for' Loops
    • Refactor Code with a Loop

    1 Answer

  • Boris Paula
    Boris Paula
    7,444 Points

    for (let i = 0; i <= 24; i+=2) { console.log(i); } any help....

    Posted March 14, 2021 3:44pm by Boris Paula
    Boris Paula
    7,444 Points
    • JavaScript
    • JavaScript Loops
    • Working with 'for' Loops
    • Refactor Code with a Loop

    2 Answers

  • Ndhokoyo Aaron
    Ndhokoyo Aaron
    6,589 Points

    The code in script.js logs all even numbers (from 2 to 24) to the JavaScript console. There seems to be a lot of redunda

    Posted March 5, 2021 4:50pm by Ndhokoyo Aaron
    Ndhokoyo Aaron
    6,589 Points
    • JavaScript
    • JavaScript Loops
    • Working with 'for' Loops
    • Refactor Code with a Loop

    1 Answer

  • Jesus Borjas
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Jesus Borjas
    Front End Web Development Techdegree Student 7,051 Points

    The code in script.js logs all even numbers (from 2 to 24) to the JavaScript console. There seems to be a lot of redunda

    Posted March 5, 2021 1:35am by Jesus Borjas
    .a{fill-rule:evenodd;}techdegree
    Jesus Borjas
    Front End Web Development Techdegree Student 7,051 Points
    • JavaScript
    • JavaScript Loops
    • Working with 'for' Loops
    • Refactor Code with a Loop

    1 Answer

  • Daniela Garcia
    Daniela Garcia
    5,071 Points

    for (let i = 2; i < 26; i += 2) not sure what I am missing....

    Posted February 19, 2021 4:11am by Daniela Garcia
    Daniela Garcia
    5,071 Points
    • JavaScript
    • JavaScript Loops
    • Working with 'for' Loops
    • Refactor Code with a Loop

    3 Answers

  • chuck kotulka
    chuck kotulka
    4,583 Points

    Refactor Code with a loop. I heard there may be a bug in this challenge. Is this true?

    Posted February 9, 2021 7:12pm by chuck kotulka
    chuck kotulka
    4,583 Points
    • JavaScript
    • JavaScript Loops
    • Working with 'for' Loops
    • Refactor Code with a Loop

    1 Answer

  • Muaaz Matwadia
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    Muaaz Matwadia
    Full Stack JavaScript Techdegree Graduate 19,327 Points

    Saying console to log one time only

    Posted January 8, 2021 7:33pm by Muaaz Matwadia
    .a{fill-rule:evenodd;}techdegree seal-36
    Muaaz Matwadia
    Full Stack JavaScript Techdegree Graduate 19,327 Points
    • JavaScript
    • JavaScript Loops
    • Working with 'for' Loops
    • Refactor Code with a Loop

    2 Answers

  • Tomas Vesely
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    Tomas Vesely
    Full Stack JavaScript Techdegree Graduate 25,309 Points

    What is wrong with my loop?

    Posted November 26, 2020 10:58pm by Tomas Vesely
    .a{fill-rule:evenodd;}techdegree seal-36
    Tomas Vesely
    Full Stack JavaScript Techdegree Graduate 25,309 Points
    • JavaScript
    • JavaScript Loops
    • Working with 'for' Loops
    • Refactor Code with a Loop

    2 Answers

  • ala4
    ala4
    3,609 Points

    what am I doing wrong here?

    Posted September 27, 2020 12:44pm by ala4
    ala4
    3,609 Points
    • JavaScript
    • JavaScript Loops
    • Working with 'for' Loops
    • Refactor Code with a Loop

    1 Answer

  • Thomas Ma
    Thomas Ma
    15,199 Points

    The code in script.js logs all even numbers (from 2 to 24) to the JavaScript console. There seems to be a lot of redunda

    Posted August 25, 2020 6:59pm by Thomas Ma
    Thomas Ma
    15,199 Points
    • JavaScript
    • JavaScript Loops
    • Working with 'for' Loops
    • Refactor Code with a Loop

    1 Answer

  • Vivian Rydh
    Vivian Rydh
    8,873 Points

    console.log() one time only

    Posted August 5, 2020 11:42am by Vivian Rydh
    Vivian Rydh
    8,873 Points
    • JavaScript
    • JavaScript Loops
    • Working with 'for' Loops
    • Refactor Code with a Loop

    2 Answers

  • jclaurent2
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    jclaurent2
    Front End Web Development Techdegree Student 10,899 Points

    There was an error with your code: ReferenceError: Strict mode forbids implicit creation of global property 'i'

    Posted July 27, 2020 10:29am by jclaurent2
    .a{fill-rule:evenodd;}techdegree
    jclaurent2
    Front End Web Development Techdegree Student 10,899 Points
    • JavaScript
    • JavaScript Loops
    • Working with 'for' Loops
    • Refactor Code with a Loop

    2 Answers

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.