🤑 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
  • Rouchen Sun
    Rouchen Sun
    1,834 Points

    Uncaught ReferenceError: createListItems is not defined

    Posted December 16, 2023 5:48pm by Rouchen Sun
    Rouchen Sun
    1,834 Points
    • JavaScript
    • JavaScript Arrays
    • Loop Through Arrays
    • Loop Through an Array

    1 Answer

  • Claire Kao
    Claire Kao
    4,393 Points

    Declaring variable outside of the function

    Posted December 13, 2023 2:45am by Claire Kao
    Claire Kao
    4,393 Points
    • JavaScript
    • JavaScript Arrays
    • Loop Through Arrays
    • Loop Through an Array

    1 Answer

  • Genesis Mukassa
    Genesis Mukassa
    1,728 Points

    createListItems is not defined

    Posted November 14, 2023 1:58pm by Genesis Mukassa
    Genesis Mukassa
    1,728 Points
    • JavaScript
    • JavaScript Arrays
    • Loop Through Arrays
    • Loop Through an Array

    2 Answers

  • Kristine Zakaite
    Kristine Zakaite
    2,236 Points

    "My music playlist" title shows much smaller and not centered.

    Posted February 6, 2023 1:24pm by Kristine Zakaite
    Kristine Zakaite
    2,236 Points
    • JavaScript
    • JavaScript Arrays
    • Loop Through Arrays
    • Loop Through an Array

    2 Answers

  • n r
    n r
    7,665 Points

    "items is not defined at createListItems"

    Posted February 2, 2023 2:17am by n r
    n r
    7,665 Points
    • JavaScript
    • JavaScript Arrays
    • Loop Through Arrays
    • Loop Through an Array

    1 Answer

  • Peter Huang
    Peter Huang
    5,427 Points

    do we need to use function to create a " li " to pass in the array?

    Posted November 27, 2022 1:52am by Peter Huang
    Peter Huang
    5,427 Points
    • JavaScript
    • JavaScript Arrays
    • Loop Through Arrays
    • Loop Through an Array

    2 Answers

  • Geovani Mejia
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Geovani Mejia
    Front End Web Development Techdegree Student 7,940 Points

    I am confused why we are using function?

    Posted April 6, 2022 10:43pm by Geovani Mejia
    .a{fill-rule:evenodd;}techdegree
    Geovani Mejia
    Front End Web Development Techdegree Student 7,940 Points
    • JavaScript
    • JavaScript Arrays
    • Loop Through Arrays
    • Loop Through an Array

    2 Answers

  • cameron williams
    cameron williams
    1,819 Points

    result '' after function. += wont work

    Posted February 24, 2022 8:54pm by cameron williams
    cameron williams
    1,819 Points
    • JavaScript
    • JavaScript Arrays
    • Loop Through Arrays
    • Loop Through an Array

    1 Answer

  • Keith Grimes
    Keith Grimes
    10,362 Points

    List is not stacked, just one long string.

    Posted January 8, 2022 11:20pm by Keith Grimes
    Keith Grimes
    10,362 Points
    • JavaScript
    • JavaScript Arrays
    • Loop Through Arrays
    • Loop Through an Array

    1 Answer

  • karan Badhwar
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    karan Badhwar
    Web Development Techdegree Graduate 18,135 Points

    empty String

    Posted December 7, 2021 3:44am by karan Badhwar
    .a{fill-rule:evenodd;}techdegree seal-36
    karan Badhwar
    Web Development Techdegree Graduate 18,135 Points
    • JavaScript
    • JavaScript Arrays
    • Loop Through Arrays
    • Loop Through an Array

    1 Answer

  • AHARON YOSEF
    AHARON YOSEF
    2,413 Points

    My playlist threw an error when I added a song

    Posted December 3, 2021 1:30am by AHARON YOSEF
    AHARON YOSEF
    2,413 Points
    • JavaScript
    • JavaScript Arrays
    • Loop Through Arrays
    • Loop Through an Array

    1 Answer

  • Alex Godfrey
    Alex Godfrey
    9,249 Points

    Every other list item is a blank line (I have 12 lines instead of 6)... help!

    Posted October 20, 2021 3:23pm by Alex Godfrey
    Alex Godfrey
    9,249 Points
    • JavaScript
    • JavaScript Arrays
    • Loop Through Arrays
    • Loop Through an Array

    1 Answer

  • Esther AlQaisi
    Esther AlQaisi
    2,311 Points

    Why is "return items" outside of the for loop?

    Posted May 3, 2021 11:35am by Esther AlQaisi
    Esther AlQaisi
    2,311 Points
    • JavaScript
    • JavaScript Arrays
    • Loop Through Arrays
    • Loop Through an Array

    1 Answer

  • Hanwen Zhang
    Hanwen Zhang
    20,084 Points

    Why items = ''? why it starts emptyy?

    Posted March 27, 2021 11:02pm by Hanwen Zhang
    Hanwen Zhang
    20,084 Points
    • JavaScript
    • JavaScript Arrays
    • Loop Through Arrays
    • Loop Through an Array

    2 Answers

  • Hanwen Zhang
    Hanwen Zhang
    20,084 Points

    Do we only name the parameter as "arr"? How do the loop know that "arr" is referred to the array we assigned to ?

    Posted March 27, 2021 11:00pm by Hanwen Zhang
    Hanwen Zhang
    20,084 Points
    • JavaScript
    • JavaScript Arrays
    • Loop Through Arrays
    • Loop Through an Array

    1 Answer

  • Tyson Denis
    seal-mask
    PLUS
    .a{fill-rule:evenodd;}techdegree seal-36
    Tyson Denis
    Front End Web Development Techdegree Graduate 15,805 Points

    arr is undefined

    Posted February 19, 2021 7:49pm by Tyson Denis
    .a{fill-rule:evenodd;}techdegree seal-36
    Tyson Denis
    Front End Web Development Techdegree Graduate 15,805 Points
    • JavaScript
    • JavaScript Arrays
    • Loop Through Arrays
    • Loop Through an Array

    1 Answer

  • ja5on
    ja5on
    10,338 Points

    argument

    Posted January 17, 2021 8:10pm by ja5on
    ja5on
    10,338 Points
    • JavaScript
    • JavaScript Arrays
    • Loop Through Arrays
    • Loop Through an Array

    12 Answers

  • ja5on
    ja5on
    10,338 Points

    for loop problem

    Posted December 8, 2020 12:03pm by ja5on
    ja5on
    10,338 Points
    • JavaScript
    • JavaScript Arrays
    • Loop Through Arrays
    • Loop Through an Array

    1 Answer

  • Carl Mclamb
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Carl Mclamb
    Full Stack JavaScript Techdegree Student 3,516 Points

    The list won't show

    Posted November 2, 2020 2:32am by Carl Mclamb
    .a{fill-rule:evenodd;}techdegree
    Carl Mclamb
    Full Stack JavaScript Techdegree Student 3,516 Points
    • JavaScript
    • JavaScript Arrays
    • Loop Through Arrays
    • Loop Through an Array

    1 Answer

  • Rachael Zordan
    Rachael Zordan
    1,379 Points

    Why was 'arr' used to pass the array to the function when the array name is 'playlist'?

    Posted September 24, 2020 10:37pm by Rachael Zordan
    Rachael Zordan
    1,379 Points
    • JavaScript
    • JavaScript Arrays
    • Loop Through Arrays
    • Loop Through an Array

    3 Answers

  • Manoj Gurung
    Manoj Gurung
    5,318 Points

    few question = what is arr ? Should we learn html before learning this.

    Posted September 20, 2020 7:47pm by Manoj Gurung
    Manoj Gurung
    5,318 Points
    • JavaScript
    • JavaScript Arrays
    • Loop Through Arrays
    • Loop Through an Array

    1 Answer

  • Gerald Susanteo
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Gerald Susanteo
    Front End Web Development Techdegree Student 7,117 Points

    What is the empty strings for?

    Posted September 19, 2020 6:12am by Gerald Susanteo
    .a{fill-rule:evenodd;}techdegree
    Gerald Susanteo
    Front End Web Development Techdegree Student 7,117 Points
    • JavaScript
    • JavaScript Arrays
    • Loop Through Arrays
    • Loop Through an Array

    1 Answer

  • Tabish Kazi
    Tabish Kazi
    5,951 Points

    Why do we have to use an empty string while declaring the variable 'items' first?

    Posted August 31, 2020 4:40pm by Tabish Kazi
    Tabish Kazi
    5,951 Points
    • JavaScript
    • JavaScript Arrays
    • Loop Through Arrays
    • Loop Through an Array

    1 Answer

  • Jelena Feliciano
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Jelena Feliciano
    Full Stack JavaScript Techdegree Student 12,729 Points

    Trying to understand why nothing is showing on the console like the teachers example.

    Posted July 16, 2020 3:15pm by Jelena Feliciano
    .a{fill-rule:evenodd;}techdegree
    Jelena Feliciano
    Full Stack JavaScript Techdegree Student 12,729 Points
    • JavaScript
    • JavaScript Arrays
    • Loop Through Arrays
    • Loop Through an Array

    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.