Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Foundations Functions Return Values

lost

asdfasdf

index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>JavaScript Foundations: Functions</title>
    <style>
      html {
        background: #FAFAFA;
        font-family: sans-serif;
      }
    </style>
  </head>
  <body>
    <h1>JavaScript Foundations</h1>
    <h2>Functions: Return Values</h2>
    <script>

      function arrayCounter ([]) {
        if (

    </script>
  </body>
</html>

1 Answer

Your on the right track, but there is an issue with this challenge. It wasn't taught in this video but you need to use the OR statement " | | "

First you need to add your parameter into the function.

second in the if clause you need to use the typeof "parameter" and see if that equals typeof "parameter 'string' || typeof "parameter" 'number' || typeof "parameter 'undefined' if so then return 0 else return parameter.length.

I hope this helps. this was a hard challenge because we never learned the " || " statement.