Skip to content

Latest commit

 

History

History

25-function-parameters

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Lesson 25: Function parameters

Default values, rest params, and destructured params.

What you'll learn

  • default: function f(x = 10) {}
  • rest: function f(...args) {} collects extras into an array
  • destructured: function f({ name, age }) {}
  • params are positional unless you use an options object

Example

See examples/.

Exercise

Write a range(start, end, step = 1) with a default step.