✨ 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
    • JavaScript Arrays
    • Loop Through Arrays
    • Loop Through an Array
    • Close
  • Rouchen Sun
    Rouchen Sun
    1,834 Points

    Uncaught ReferenceError: createListItems is not defined

    Posted on Dec 16, 2023 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 on Dec 13, 2023 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 on Nov 14, 2023 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 on Feb 6, 2023 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 on Feb 2, 2023 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 on Nov 27, 2022 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 on Apr 6, 2022 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 on Feb 24, 2022 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 on Jan 8, 2022 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 on Dec 7, 2021 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 on Dec 3, 2021 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 on Oct 20, 2021 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 on May 3, 2021 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 on Mar 27, 2021 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 on Mar 27, 2021 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 on Feb 19, 2021 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 on Jan 17, 2021 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 on Dec 8, 2020 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 on Nov 2, 2020 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 on Sep 24, 2020 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 on Sep 20, 2020 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 on Sep 19, 2020 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 on Aug 31, 2020 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 on Jul 16, 2020 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.