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

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