From 794515973b1ee4416c188448d4f5322c6c9d1761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=81nis=20Elmeris?= Date: Tue, 24 Oct 2017 14:23:21 +0300 Subject: [PATCH] Mention the spread operator. --- content/en/tags-param.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/content/en/tags-param.md b/content/en/tags-param.md index 1d82b3d0..ee5b4532 100644 --- a/content/en/tags-param.md +++ b/content/en/tags-param.md @@ -239,6 +239,20 @@ function sum(num) { return t; } ``` + +This syntax includes the usage of the spread operator `...`: + +```js +/** + * @param {string} meal - The name of the meal (e.g., "breakfast"). + * @param {...Object} products - What is being eaten. + */ +function eatMeal(meal, ...products) { + swallow(...products); + log('Meal ', meal, ' was done at ', new Date); +} +``` + {% endexample %} ### Callback functions