javascripting icon indicating copy to clipboard operation
javascripting copied to clipboard

FUNCTION RETURN VALUES

Open ledsun opened this issue 6 years ago • 2 comments

This is a proposal for a new challenge. Please give me ideas and feedback.

Title

FUNCTION RETURN VALUES

Goal

Learn how to handle function return values.

Problem

The result of the function is a value. You can get the result of the function as follows:

const ret = Math.random()

The challenge:

Create a file named function-return-value.js.

*** TODO ***

Check to see if your program is correct by running this command:

javascripting verify arrays.js

TODO

  • [ ] What are the challenges of learning to handle function return values?
  • [ ] Should this challenge include "Destructuring assignment"?

ledsun avatar Sep 25 '19 03:09 ledsun

I think one of the main challenges is arrow functions and how they work. const func = x => x const func = (x, y) => y

const func = (x, y) => {
  return x
}
const func = x => (
  `No return statement needed for ${x}`
)

There are multiple different syntaxes to accomplish the same thing.

itzsaga avatar Sep 26 '19 14:09 itzsaga

There are currently no challenges to handle the arrow function. I think we need to create an arrow function challenge before we can reference the arrow function.

ledsun avatar Oct 01 '19 15:10 ledsun