🤑 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
  • Ryan Wikle
    Ryan Wikle
    5,774 Points

    double if else statements

    Posted July 5, 2021 7:43am by Ryan Wikle
    Ryan Wikle
    5,774 Points
    • JavaScript
    • DOM Scripting By Example
    • Improving the Application Code
    • Refactor 2: Readable Branching Logic

    1 Answer

  • Jonathan Guerrero
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    Jonathan Guerrero
    Front End Web Development Techdegree Graduate 18,245 Points

    I don't understand how to use the '[]' and when to use it.

    Posted April 2, 2021 12:18am by Jonathan Guerrero
    .a{fill-rule:evenodd;}techdegree seal-36
    Jonathan Guerrero
    Front End Web Development Techdegree Graduate 18,245 Points
    • JavaScript
    • DOM Scripting By Example
    • Improving the Application Code
    • Refactor 2: Readable Branching Logic

    2 Answers

  • Seth Lewis
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    Seth Lewis
    Full Stack JavaScript Techdegree Graduate 18,191 Points

    ANOTHER Uncaught TypeError: nameActions[action] is not a function

    Posted August 21, 2020 3:42pm by Seth Lewis
    .a{fill-rule:evenodd;}techdegree seal-36
    Seth Lewis
    Full Stack JavaScript Techdegree Graduate 18,191 Points
    • JavaScript
    • DOM Scripting By Example
    • Improving the Application Code
    • Refactor 2: Readable Branching Logic

    2 Answers

  • Kaya Jackson
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Kaya Jackson
    Full Stack JavaScript Techdegree Student 8,734 Points

    Console error

    Posted June 2, 2020 10:40pm by Kaya Jackson
    .a{fill-rule:evenodd;}techdegree
    Kaya Jackson
    Full Stack JavaScript Techdegree Student 8,734 Points
    • JavaScript
    • DOM Scripting By Example
    • Improving the Application Code
    • Refactor 2: Readable Branching Logic

    2 Answers

  • James Estrada
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    James Estrada
    Full Stack JavaScript Techdegree Student 25,867 Points

    Question about arrow functions as values in object literal

    Posted April 25, 2020 3:13pm by James Estrada
    .a{fill-rule:evenodd;}techdegree
    James Estrada
    Full Stack JavaScript Techdegree Student 25,867 Points
    • JavaScript
    • DOM Scripting By Example
    • Improving the Application Code
    • Refactor 2: Readable Branching Logic

    1 Answer

  • William Ray Noble
    William Ray Noble
    22,190 Points

    Save button will not work

    Posted April 14, 2020 5:55pm by William Ray Noble
    William Ray Noble
    22,190 Points
    • JavaScript
    • DOM Scripting By Example
    • Improving the Application Code
    • Refactor 2: Readable Branching Logic

    1 Answer

  • Zachary Danz
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    Zachary Danz
    Front End Web Development Techdegree Graduate 15,024 Points

    Uncaught TypeError: nameActions[action] is not a function

    Posted March 11, 2020 9:49pm by Zachary Danz
    .a{fill-rule:evenodd;}techdegree seal-36
    Zachary Danz
    Front End Web Development Techdegree Graduate 15,024 Points
    • JavaScript
    • DOM Scripting By Example
    • Improving the Application Code
    • Refactor 2: Readable Branching Logic

    2 Answers

  • shaun bolak
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    shaun bolak
    Front End Web Development Techdegree Graduate 18,080 Points

    Javascript DOM scripting - click event listener not firing after refactoring...

    Posted February 21, 2020 5:35pm by shaun bolak
    .a{fill-rule:evenodd;}techdegree seal-36
    shaun bolak
    Front End Web Development Techdegree Graduate 18,080 Points
    • JavaScript
    • DOM Scripting By Example
    • Improving the Application Code
    • Refactor 2: Readable Branching Logic

    2 Answers

  • John Raven Aquino
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    John Raven Aquino
    Full Stack JavaScript Techdegree Student 11,073 Points

    Made my own version of refactoring, can you please rate my sheet and i'm open for suggestions,criticism

    Posted December 22, 2019 3:04pm by John Raven Aquino
    .a{fill-rule:evenodd;}techdegree
    John Raven Aquino
    Full Stack JavaScript Techdegree Student 11,073 Points
    • JavaScript
    • DOM Scripting By Example
    • Improving the Application Code
    • Refactor 2: Readable Branching Logic

    0 Answers

  • Stefan Schraberger
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Stefan Schraberger
    Front End Web Development Techdegree Student 8,873 Points

    Why cant we use dot notation here : nameActions[action]();

    Posted August 29, 2019 6:24pm by Stefan Schraberger
    .a{fill-rule:evenodd;}techdegree
    Stefan Schraberger
    Front End Web Development Techdegree Student 8,873 Points
    • JavaScript
    • DOM Scripting By Example
    • Improving the Application Code
    • Refactor 2: Readable Branching Logic

    1 Answer

  • Stefan Schraberger
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Stefan Schraberger
    Front End Web Development Techdegree Student 8,873 Points

    Calling the function assigned to the property

    Posted August 29, 2019 6:21pm by Stefan Schraberger
    .a{fill-rule:evenodd;}techdegree
    Stefan Schraberger
    Front End Web Development Techdegree Student 8,873 Points
    • JavaScript
    • DOM Scripting By Example
    • Improving the Application Code
    • Refactor 2: Readable Branching Logic

    1 Answer

  • Siddharth Pandey
    Siddharth Pandey
    7,280 Points

    Why doesn't this work?

    Posted August 10, 2019 6:46pm by Siddharth Pandey
    Siddharth Pandey
    7,280 Points
    • JavaScript
    • DOM Scripting By Example
    • Improving the Application Code
    • Refactor 2: Readable Branching Logic

    1 Answer

  • Ewerton Luna
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    Ewerton Luna
    Full Stack JavaScript Techdegree Graduate 24,031 Points

    The console says: Uncaught TypeError: nameActions[action] is not a function, after refactoring.

    Posted August 2, 2019 2:30pm by Ewerton Luna
    .a{fill-rule:evenodd;}techdegree seal-36
    Ewerton Luna
    Full Stack JavaScript Techdegree Graduate 24,031 Points
    • JavaScript
    • DOM Scripting By Example
    • Improving the Application Code
    • Refactor 2: Readable Branching Logic

    1 Answer

  • Tony Minseok Kim
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Tony Minseok Kim
    Front End Web Development Techdegree Student 11,682 Points

    In real life situation, or workplace situation

    Posted May 23, 2019 6:09am by Tony Minseok Kim
    .a{fill-rule:evenodd;}techdegree
    Tony Minseok Kim
    Front End Web Development Techdegree Student 11,682 Points
    • JavaScript
    • DOM Scripting By Example
    • Improving the Application Code
    • Refactor 2: Readable Branching Logic

    1 Answer

  • Todd Alcock
    Todd Alcock
    5,516 Points

    Refactor on very last step

    Posted November 24, 2018 4:27pm by Todd Alcock
    Todd Alcock
    5,516 Points
    • JavaScript
    • DOM Scripting By Example
    • Improving the Application Code
    • Refactor 2: Readable Branching Logic

    1 Answer

  • Liam Hayes
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Liam Hayes
    Full Stack JavaScript Techdegree Student 13,116 Points

    Could somebody explain this syntax to me? nameActions[action]();

    Posted August 30, 2018 6:17pm by Liam Hayes
    .a{fill-rule:evenodd;}techdegree
    Liam Hayes
    Full Stack JavaScript Techdegree Student 13,116 Points
    • JavaScript
    • DOM Scripting By Example
    • Improving the Application Code
    • Refactor 2: Readable Branching Logic

    2 Answers

  • Jeff Muday
    MOD
    Jeff Muday
    Treehouse Moderator 28,726 Points

    Is using a textContent string to make branching decisions a questionable practice?

    Posted August 17, 2018 4:29pm by Jeff Muday
    Jeff Muday
    Treehouse Moderator 28,726 Points
    • JavaScript
    • DOM Scripting By Example
    • Improving the Application Code
    • Refactor 2: Readable Branching Logic

    2 Answers

  • roberto benites
    roberto benites
    2,897 Points

    Can someone explain the "bracket" notation that s used to pass the strings? I'm not sure i fully understand how its used

    Posted May 30, 2018 5:42am by roberto benites
    roberto benites
    2,897 Points
    • JavaScript
    • DOM Scripting By Example
    • Improving the Application Code
    • Refactor 2: Readable Branching Logic

    1 Answer

  • Marcus Schumacher
    Marcus Schumacher
    16,616 Points

    Where to learn more about these kinds of JS object abilities?

    Posted May 8, 2018 9:03pm by Marcus Schumacher
    Marcus Schumacher
    16,616 Points
    • JavaScript
    • DOM Scripting By Example
    • Improving the Application Code
    • Refactor 2: Readable Branching Logic

    1 Answer

  • Conary Beckford
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Conary Beckford
    Full Stack JavaScript Techdegree Student 5,046 Points

    Refactor 2

    Posted April 18, 2018 3:15pm by Conary Beckford
    .a{fill-rule:evenodd;}techdegree
    Conary Beckford
    Full Stack JavaScript Techdegree Student 5,046 Points
    • JavaScript
    • DOM Scripting By Example
    • Improving the Application Code
    • Refactor 2: Readable Branching Logic

    2 Answers

  • tomd
    tomd
    16,701 Points

    Why is there a const for the ul? It was declared at the top of the page.

    Posted March 27, 2018 8:07am by tomd
    tomd
    16,701 Points
    • JavaScript
    • DOM Scripting By Example
    • Improving the Application Code
    • Refactor 2: Readable Branching Logic

    2 Answers

  • shirshah sahel
    shirshah sahel
    10,035 Points

    Refactor 2: Readable Branching Logic

    Posted August 17, 2017 10:20pm by shirshah sahel
    shirshah sahel
    10,035 Points
    • JavaScript
    • DOM Scripting By Example
    • Improving the Application Code
    • Refactor 2: Readable Branching Logic

    7 Answers

  • Vic Mercier
    Vic Mercier
    3,276 Points

    Which method should I use in object . vs []

    Posted August 1, 2017 10:34pm by Vic Mercier
    Vic Mercier
    3,276 Points
    • JavaScript
    • DOM Scripting By Example
    • Improving the Application Code
    • Refactor 2: Readable Branching Logic

    1 Answer

  • Jonathon Irizarry
    Jonathon Irizarry
    9,154 Points

    Shouldn't you use function expressions?

    Posted July 24, 2017 12:30pm by Jonathon Irizarry
    Jonathon Irizarry
    9,154 Points
    • JavaScript
    • DOM Scripting By Example
    • Improving the Application Code
    • Refactor 2: Readable Branching Logic

    1 Answer

  • Mark Bojesen
    Mark Bojesen
    12,873 Points

    Keep getting: "nameActions[action] is not a function"

    Posted May 31, 2017 5:42pm by Mark Bojesen
    Mark Bojesen
    12,873 Points
    • JavaScript
    • DOM Scripting By Example
    • Improving the Application Code
    • Refactor 2: Readable Branching Logic

    1 Answer

  • Luca Di Pinto
    Luca Di Pinto
    8,051 Points

    Clarifications...

    Posted March 14, 2017 9:32pm by Luca Di Pinto
    Luca Di Pinto
    8,051 Points
    • JavaScript
    • DOM Scripting By Example
    • Improving the Application Code
    • Refactor 2: Readable Branching Logic

    3 Answers

  • mark scholes
    mark scholes
    9,343 Points

    This is just an observation rather than a question.

    Posted March 5, 2017 3:47pm by mark scholes
    mark scholes
    9,343 Points
    • JavaScript
    • DOM Scripting By Example
    • Improving the Application Code
    • Refactor 2: Readable Branching Logic

    7 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.