# How to define rest parameter for a function in JavaScript?

JavascriptWeb DevelopmentFront End Technology

With rest parameter, you can represent a number of arguments as an array. ES6 brought rest parameter to ease the work of developers. For arguments objects, rest parameters are indicated by three dots … and precedes a parameter.

## Example

Let’s see the following code snippet to define rest parameter.

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