Skip to content
Advertisement

Spreading for object as function input arguments

I want to pass in “he”, and “she” to function func and output “heshe”.

Is there any way to spread the value of object (like array) to make it work?

JavaScript

Advertisement

Answer

You’ll need to use Object.values().

In your example:

JavaScript
Advertisement