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.

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

✨ Earn college credits in Cybersecurity, JS, HTML, CSS and Python

  • 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
  • Nelson J
    Nelson J
    7,411 Points

    person variable without the 'var' keyword in the console.

    Posted April 15, 2019 1:32am by Nelson J
    Nelson J
    7,411 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Variable Scope

    2 Answers

  • meghana Joshi
    meghana Joshi
    4,596 Points

    Don't we use let instead of var now

    Posted January 17, 2019 1:54pm by meghana Joshi
    meghana Joshi
    4,596 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Variable Scope

    1 Answer

  • Abubakr Alhaj
    Abubakr Alhaj
    4,297 Points

    I understood the scope of the function but in the min. 1:23 it's very confusing because when you see the demonstration.

    Posted September 16, 2018 7:25am by Abubakr Alhaj
    Abubakr Alhaj
    4,297 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Variable Scope

    1 Answer

  • Azul Bleu
    PLUS
    Azul Bleu
    Courses Plus Student 1,015 Points

    Isn't there times when what you want exactly is to override the global scope?

    Posted November 27, 2017 11:29am by Azul Bleu
    Azul Bleu
    Courses Plus Student 1,015 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Variable Scope

    1 Answer

  • Shumin Zhou
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    Shumin Zhou
    Full Stack JavaScript Techdegree Graduate 32,510 Points

    why is show the string Lilha, George than Lilha angain!!

    Posted August 25, 2017 10:38am by Shumin Zhou
    .a{fill-rule:evenodd;}techdegree seal-36
    Shumin Zhou
    Full Stack JavaScript Techdegree Graduate 32,510 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Variable Scope

    2 Answers

  • Enemuo Felix
    Enemuo Felix
    1,895 Points

    Just really want to know if I'm on the same page with this

    Posted August 23, 2017 5:41pm by Enemuo Felix
    Enemuo Felix
    1,895 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Variable Scope

    1 Answer

  • Ming Jun Lim
    Ming Jun Lim
    10,060 Points

    i'm a little bit confused

    Posted June 30, 2017 7:36pm by Ming Jun Lim
    Ming Jun Lim
    10,060 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Variable Scope

    1 Answer

  • Michael Lambert
    Michael Lambert
    6,286 Points

    Accessing global scopes

    Posted June 18, 2017 8:28pm by Michael Lambert
    Michael Lambert
    6,286 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Variable Scope

    4 Answers

  • Audra Ogilvy
    Audra Ogilvy
    3,142 Points

    The function finds the variable in the global scope?

    Posted June 11, 2017 11:54pm by Audra Ogilvy
    Audra Ogilvy
    3,142 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Variable Scope

    4 Answers

  • Timothy Huxley
    PLUS
    Timothy Huxley
    Courses Plus Student 4,781 Points

    Are there any tools to give us warnings and help us avoid risky code?

    Posted January 19, 2017 10:49am by Timothy Huxley
    Timothy Huxley
    Courses Plus Student 4,781 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Variable Scope

    2 Answers

  • Karl Pupé
    Karl Pupé
    6,718 Points

    Variable Scope - why Lilah, George and Lilah?

    Posted October 18, 2016 1:49pm by Karl Pupé
    Karl Pupé
    6,718 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Variable Scope

    1 Answer

  • MICHAEL P
    MICHAEL P
    5,191 Points

    I need a simple explanation of global functions within JavaScript, please?

    Posted September 8, 2016 5:33pm by MICHAEL P
    MICHAEL P
    5,191 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Variable Scope

    4 Answers

  • Abir Ahmed
    PLUS
    Abir Ahmed
    Courses Plus Student 8,616 Points

    Why by removing "var" of the functions make functions look for a variable in Global Scope?

    Posted May 22, 2016 8:03pm by Abir Ahmed
    Abir Ahmed
    Courses Plus Student 8,616 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Variable Scope

    1 Answer

  • Mohammed Jammeh
    Mohammed Jammeh
    37,463 Points

    Accessing a variable inside a function..

    Posted March 26, 2016 10:01pm by Mohammed Jammeh
    Mohammed Jammeh
    37,463 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Variable Scope

    4 Answers

  • Michal Janek
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    Michal Janek
    Front End Web Development Techdegree Graduate 30,654 Points

    Why Lilah 3rd time?

    Posted March 2, 2016 7:08pm by Michal Janek
    .a{fill-rule:evenodd;}techdegree seal-36
    Michal Janek
    Front End Web Development Techdegree Graduate 30,654 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Variable Scope

    2 Answers

  • Philip Bessa
    Philip Bessa
    5,396 Points

    Over-complicated? Why not rename a variable?

    Posted August 10, 2015 7:25pm by Philip Bessa
    Philip Bessa
    5,396 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Variable Scope

    2 Answers

  • Durdona Abdusamikovna
    Durdona Abdusamikovna
    1,553 Points

    I need better explanation on SCOPE

    Posted April 13, 2015 2:06pm by Durdona Abdusamikovna
    Durdona Abdusamikovna
    1,553 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Variable Scope

    14 Answers

  • Durdona Abdusamikovna
    Durdona Abdusamikovna
    1,553 Points

    Can someone suggest me any JavaScript Debugger ... ? I really want to see how each line of codes are running.

    Posted April 13, 2015 3:56am by Durdona Abdusamikovna
    Durdona Abdusamikovna
    1,553 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Variable Scope

    3 Answers

  • Corey Standish
    Corey Standish
    14,835 Points

    Besides asking to have the basic lessons "Dumbed Down" even more, are there any tips on learning the basics?

    Posted March 19, 2015 12:00am by Corey Standish
    Corey Standish
    14,835 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Variable Scope

    4 Answers

  • VIVIAN CENTENO
    VIVIAN CENTENO
    2,335 Points

    Code Challenge: Create a function named max()

    Posted January 9, 2015 4:18am by VIVIAN CENTENO
    VIVIAN CENTENO
    2,335 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Variable Scope

    6 Answers

  • John Haas
    John Haas
    1,756 Points

    Scope question.

    Posted December 4, 2014 12:45am by John Haas
    John Haas
    1,756 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Variable Scope

    1 Answer

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