# Help in understanding spread syntax console.log

**URL:** <https://forum.freecodecamp.org/t/help-in-understanding-spread-syntax-console-log/514889>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [June 5, 2022, 1:42pm UTC](https://forum.freecodecamp.org/t/help-in-understanding-spread-syntax-console-log/514889 "2022-06-05T13:42:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chefjimmy09](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/chefjimmy09/32/244801_2.png) [@chefjimmy09](https://forum.freecodecamp.org/u/chefjimmy09)\
**Post date:** [June 5, 2022, 1:42pm UTC](https://forum.freecodecamp.org/t/help-in-understanding-spread-syntax-console-log/514889/1 "2022-06-05T13:42:13Z")

</div>

In the function shown below I do understand what is going on with the syntax and the function. My confusion is in the second console.log. Can someone explain what is going on with (“string”, null, [1, 2, 3], {})) ?

function howMany(…args) {  
return “You have passed " + args.length + " arguments.”;  
}  
console.log(howMany(0, 1, 2)); // You have passed 3 arguments.  
console.log(howMany(“string”, null, [1, 2, 3], {})); // You have passed 4 arguments.

---

<div class="post-metadata">

**Author:** ![udaaff](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/udaaff/32/243810_2.png) [@udaaff](https://forum.freecodecamp.org/u/udaaff)\
**Post date:** [June 5, 2022, 2:09pm UTC](https://forum.freecodecamp.org/t/help-in-understanding-spread-syntax-console-log/514889/2 "2022-06-05T14:09:52Z")

</div>

second console log arguments just like the first ones but have different types, like string, null, array, object.

---

<div class="post-metadata">

**Author:** ![chefjimmy09](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/chefjimmy09/32/244801_2.png) [@chefjimmy09](https://forum.freecodecamp.org/u/chefjimmy09)\
**Post date:** [June 6, 2022, 1:43pm UTC](https://forum.freecodecamp.org/t/help-in-understanding-spread-syntax-console-log/514889/3 "2022-06-06T13:43:05Z")

</div>

Thank you I can see that and thanks for the reply. If I understand this correctly its just filler. Does not matter on what was entered (sort of) it is simply pulling the data type. If I delete null for example it will return 3 arguments.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [December 6, 2022, 1:43am UTC](https://forum.freecodecamp.org/t/help-in-understanding-spread-syntax-console-log/514889/4 "2022-12-06T01:43:21Z")

</div>

Closed on December 6, 2022, 1:43am UTC

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
