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.

✨ 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
  • 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,686 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,686 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.

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