✨ 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 Basics (Retired)
    • Creating Reusable Code with Functions
    • Introducing Functions
    • Close
  • Tadjiev Codes
    Tadjiev Codes
    9,626 Points

    Write a program that asks the user for two integer numbers. Compare the two numbers and output the higher one ????

    Posted on Feb 10, 2020 by Tadjiev Codes
    Tadjiev Codes
    9,626 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Introducing Functions

    2 Answers

  • Jake Smith
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Jake Smith
    Data Analysis Techdegree Student 15,921 Points

    What are some use cases for function declarations vs function expressions?

    Posted on Jul 10, 2019 by Jake Smith
    .a{fill-rule:evenodd;}techdegree
    Jake Smith
    Data Analysis Techdegree Student 15,921 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Introducing Functions

    1 Answer

  • vamosrope14
    vamosrope14
    14,932 Points

    Do you always have to write a variable for a return value?

    Posted on Jun 5, 2019 by vamosrope14
    vamosrope14
    14,932 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Introducing Functions

    1 Answer

  • Jesse Dispoto
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    Jesse Dispoto
    Front End Web Development Techdegree Graduate 14,538 Points

    Can anonymous functions only be used once in a given piece of code?

    Posted on Feb 1, 2019 by Jesse Dispoto
    .a{fill-rule:evenodd;}techdegree seal-36
    Jesse Dispoto
    Front End Web Development Techdegree Graduate 14,538 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Introducing Functions

    1 Answer

  • Nick Evershed
    Nick Evershed
    6,429 Points

    Anonymous functions

    Posted on Oct 16, 2018 by Nick Evershed
    Nick Evershed
    6,429 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Introducing Functions

    2 Answers

  • Philip Kroupoderov
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    Philip Kroupoderov
    Front End Web Development Techdegree Graduate 21,641 Points

    Any particular reason for using anonymous functions??

    Posted on Dec 29, 2017 by Philip Kroupoderov
    .a{fill-rule:evenodd;}techdegree seal-36
    Philip Kroupoderov
    Front End Web Development Techdegree Graduate 21,641 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Introducing Functions

    1 Answer

  • Rwanda Muhammad
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Rwanda Muhammad
    Full Stack JavaScript Techdegree Student 4,116 Points

    The code is not working

    Posted on Aug 23, 2017 by Rwanda Muhammad
    .a{fill-rule:evenodd;}techdegree
    Rwanda Muhammad
    Full Stack JavaScript Techdegree Student 4,116 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Introducing Functions

    3 Answers

  • Alex Sorrells
    Alex Sorrells
    530 Points

    Just curious..

    Posted on Jul 30, 2017 by Alex Sorrells
    Alex Sorrells
    530 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Introducing Functions

    1 Answer

  • Eric Jusic
    Eric Jusic
    4,350 Points

    Is there any other difference between function and anonymous function?

    Posted on Jul 19, 2017 by Eric Jusic
    Eric Jusic
    4,350 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Introducing Functions

    2 Answers

  • Alex Jederlinic
    PLUS
    Alex Jederlinic
    Courses Plus Student 1,148 Points

    I can't seem to get the windows to pop-up on the preview page of workspaces. Any idea why? I link it, save it and nothin

    Posted on Jun 13, 2017 by Alex Jederlinic
    Alex Jederlinic
    Courses Plus Student 1,148 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Introducing Functions

    1 Answer

  • Vic Mercier
    Vic Mercier
    3,276 Points

    function expression and function

    Posted on Jun 1, 2017 by Vic Mercier
    Vic Mercier
    3,276 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Introducing Functions

    2 Answers

  • David Dong
    David Dong
    5,593 Points

    Statements Inside Functions Repeating

    Posted on Dec 9, 2016 by David Dong
    David Dong
    5,593 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Introducing Functions

    5 Answers

  • Victor Horton
    Victor Horton
    20,277 Points

    Why won't this add up my score?

    Posted on Sep 11, 2016 by Victor Horton
    Victor Horton
    20,277 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Introducing Functions

    1 Answer

  • Atul R
    Atul R
    3,446 Points

    Why is it not working this way?

    Posted on Jul 4, 2016 by Atul R
    Atul R
    3,446 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Introducing Functions

    1 Answer

  • Valeriya Voloshina
    Valeriya Voloshina
    5,943 Points

    My code doesn't work

    Posted on Nov 6, 2015 by Valeriya Voloshina
    Valeriya Voloshina
    5,943 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Introducing Functions

    2 Answers

  • Justin Olson
    Justin Olson
    13,792 Points

    What's the difference?

    Posted on Aug 25, 2015 by Justin Olson
    Justin Olson
    13,792 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Introducing Functions

    3 Answers

  • jaeeunlee
    jaeeunlee
    3,127 Points

    Poor assistant... Why can't you give the assistant something more rewarding to do?

    Posted on Jul 5, 2015 by jaeeunlee
    jaeeunlee
    3,127 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Introducing Functions

    2 Answers

  • Sean Flanagan
    Sean Flanagan
    33,236 Points

    Can't generate numbers

    Posted on Jun 15, 2015 by Sean Flanagan
    Sean Flanagan
    33,236 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Introducing Functions

    1 Answer

  • Joel Glovier
    Joel Glovier
    3,010 Points

    When is it helpful to store a function in a variable instead of simply writing a function declaration?

    Posted on Apr 13, 2015 by Joel Glovier
    Joel Glovier
    3,010 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Introducing Functions

    2 Answers

  • ori
    ori
    2,307 Points

    What does the code inside the Math.random() function actually look like? How can I find that out?

    Posted on Mar 13, 2015 by ori
    ori
    2,307 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Introducing Functions

    3 Answers

  • Sally Gradle
    Sally Gradle
    24,694 Points

    Wrong Workspace Connected to Video

    Posted on Feb 18, 2015 by Sally Gradle
    Sally Gradle
    24,694 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Introducing Functions

    1 Answer

  • samantha caplan
    samantha caplan
    2,932 Points

    The workspace for this lesson doesn't launch (it's an old workspace), and you can not choose the correct one manually :(

    Posted on Feb 8, 2015 by samantha caplan
    samantha caplan
    2,932 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Introducing Functions

    1 Answer

  • Leisa Clark
    Leisa Clark
    4,531 Points

    Workspace wrong

    Posted on Jan 20, 2015 by Leisa Clark
    Leisa Clark
    4,531 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Introducing Functions

    0 Answers

  • Tony Brackins
    Tony Brackins
    28,766 Points

    document.print not working

    Posted on Nov 29, 2014 by Tony Brackins
    Tony Brackins
    28,766 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Introducing Functions

    1 Answer

  • Eric Orellana
    Eric Orellana
    4,105 Points

    Dave McFarland Fantastic Job!!!

    Posted on Nov 12, 2014 by Eric Orellana
    Eric Orellana
    4,105 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Introducing Functions

    10 Answers

  • Oly Su
    Oly Su
    6,119 Points

    What are the pro's and con's of using Function Statement v.s. Function Expression?

    Posted on Nov 4, 2014 by Oly Su
    Oly Su
    6,119 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Introducing Functions

    1 Answer

  • Richard Nash
    Richard Nash
    24,862 Points

    Statements, Declarations and Expressions. Which is which?

    Posted on Oct 31, 2014 by Richard Nash
    Richard Nash
    24,862 Points
    • JavaScript
    • JavaScript Basics (Retired)
    • Creating Reusable Code with Functions
    • Introducing Functions

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