🤑 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
  • Gheon Steenkamp
    Gheon Steenkamp
    458 Points

    function getYear() { const year = new Date().getFullYear(); return year; Store the returned value of the function in

    Posted June 3, 2023 9:38am by Gheon Steenkamp
    Gheon Steenkamp
    458 Points
    • JavaScript
    • JavaScript Functions
    • Create Reusable Code with Functions
    • Return a Value from a Function

    1 Answer

  • Ricky Redman
    Ricky Redman
    7,520 Points

    yearToday

    Posted July 27, 2021 11:03pm by Ricky Redman
    Ricky Redman
    7,520 Points
    • JavaScript
    • JavaScript Functions
    • Create Reusable Code with Functions
    • Return a Value from a Function

    1 Answer

  • james presley
    james presley
    6,154 Points

    anyone kno the answer to this!!!

    Posted March 20, 2021 9:07pm by james presley
    james presley
    6,154 Points
    • JavaScript
    • JavaScript Functions
    • Create Reusable Code with Functions
    • Return a Value from a Function

    1 Answer

  • james presley
    james presley
    6,154 Points

    what am i missing.

    Posted March 20, 2021 6:46pm by james presley
    james presley
    6,154 Points
    • JavaScript
    • JavaScript Functions
    • Create Reusable Code with Functions
    • Return a Value from a Function

    1 Answer

  • Muaaz Matwadia
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    Muaaz Matwadia
    Full Stack JavaScript Techdegree Graduate 19,327 Points

    Return

    Posted January 6, 2021 9:57am by Muaaz Matwadia
    .a{fill-rule:evenodd;}techdegree seal-36
    Muaaz Matwadia
    Full Stack JavaScript Techdegree Graduate 19,327 Points
    • JavaScript
    • JavaScript Functions
    • Create Reusable Code with Functions
    • Return a Value from a Function

    1 Answer

  • Josef Marsden
    Josef Marsden
    439 Points

    Use the `return` keyword When you call a function, you can restore its return value in a variable.

    Posted December 1, 2020 8:54am by Josef Marsden
    Josef Marsden
    439 Points
    • JavaScript
    • JavaScript Functions
    • Create Reusable Code with Functions
    • Return a Value from a Function

    2 Answers

  • PAUL NANNEY
    PAUL NANNEY
    8,995 Points

    Basically, What is wrong with this, GOD bless, , b, PAUL JORDAN NANNEY

    Posted November 28, 2020 5:23pm by PAUL NANNEY
    PAUL NANNEY
    8,995 Points
    • JavaScript
    • JavaScript Functions
    • Create Reusable Code with Functions
    • Return a Value from a Function

    2 Answers

  • tech brain
    PLUS
    tech brain
    Courses Plus Student 1,567 Points

    Inside the function's code block, add the following line of code:

    Posted August 13, 2020 4:51am by tech brain
    tech brain
    Courses Plus Student 1,567 Points
    • JavaScript
    • JavaScript Functions
    • Create Reusable Code with Functions
    • Return a Value from a Function

    1 Answer

  • malcolm mowlam
    malcolm mowlam
    3,856 Points

    challenge task 3 of 3 javascript functions

    Posted June 29, 2020 6:44am by malcolm mowlam
    malcolm mowlam
    3,856 Points
    • JavaScript
    • JavaScript Functions
    • Create Reusable Code with Functions
    • Return a Value from a Function

    1 Answer

  • malcolm mowlam
    malcolm mowlam
    3,856 Points

    challenge task 2 of 3 javascript functions

    Posted June 29, 2020 4:59am by malcolm mowlam
    malcolm mowlam
    3,856 Points
    • JavaScript
    • JavaScript Functions
    • Create Reusable Code with Functions
    • Return a Value from a Function

    2 Answers

  • malcolm mowlam
    malcolm mowlam
    3,856 Points

    returning a function

    Posted June 29, 2020 4:05am by malcolm mowlam
    malcolm mowlam
    3,856 Points
    • JavaScript
    • JavaScript Functions
    • Create Reusable Code with Functions
    • Return a Value from a Function

    1 Answer

  • KJ Lee
    KJ Lee
    1,059 Points

    Does anyone know what the final code for this would be?

    Posted May 8, 2020 2:04am by KJ Lee
    KJ Lee
    1,059 Points
    • JavaScript
    • JavaScript Functions
    • Create Reusable Code with Functions
    • Return a Value from a Function

    2 Answers

  • ALBERT VASQUEZ
    PLUS
    ALBERT VASQUEZ
    Courses Plus Student 246 Points

    I'm not sure what I'm doing wrong, I was asked to create a function, add a return but it's not working

    Posted May 5, 2020 2:57am by ALBERT VASQUEZ
    ALBERT VASQUEZ
    Courses Plus Student 246 Points
    • JavaScript
    • JavaScript Functions
    • Create Reusable Code with Functions
    • Return a Value from a Function

    1 Answer

  • Sahmad Nakumbe
    Sahmad Nakumbe
    3,423 Points

    Finally, call the getYear function. Store the returned value of the function in a new variable named yearToday.

    Posted April 21, 2020 10:53pm by Sahmad Nakumbe
    Sahmad Nakumbe
    3,423 Points
    • JavaScript
    • JavaScript Functions
    • Create Reusable Code with Functions
    • Return a Value from a Function

    2 Answers

  • Sahmad Nakumbe
    Sahmad Nakumbe
    3,423 Points

    const year = new Date().getFullYear();

    Posted April 16, 2020 10:23pm by Sahmad Nakumbe
    Sahmad Nakumbe
    3,423 Points
    • JavaScript
    • JavaScript Functions
    • Create Reusable Code with Functions
    • Return a Value from a Function

    2 Answers

  • Sahmad Nakumbe
    Sahmad Nakumbe
    3,423 Points

    Inside the function's code block, add the following line of code: const year = new Date().getFullYear(); This creates a

    Posted April 16, 2020 5:07am by Sahmad Nakumbe
    Sahmad Nakumbe
    3,423 Points
    • JavaScript
    • JavaScript Functions
    • Create Reusable Code with Functions
    • Return a Value from a Function

    2 Answers

  • Sahmad Nakumbe
    Sahmad Nakumbe
    3,423 Points

    Inside the function's code block, add the following line of code: const year = new Date().getFullYear(); This creates a

    Posted April 14, 2020 1:25am by Sahmad Nakumbe
    Sahmad Nakumbe
    3,423 Points
    • JavaScript
    • JavaScript Functions
    • Create Reusable Code with Functions
    • Return a Value from a Function

    2 Answers

  • Sezare Miguel
    Sezare Miguel
    9,229 Points

    return a value from function

    Posted April 4, 2020 7:17pm by Sezare Miguel
    Sezare Miguel
    9,229 Points
    • JavaScript
    • JavaScript Functions
    • Create Reusable Code with Functions
    • Return a Value from a Function

    0 Answers

  • Sezare Miguel
    Sezare Miguel
    9,229 Points

    return a value from function

    Posted April 4, 2020 7:17pm by Sezare Miguel
    Sezare Miguel
    9,229 Points
    • JavaScript
    • JavaScript Functions
    • Create Reusable Code with Functions
    • Return a Value from a Function

    1 Answer

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.