Skip to content

Return multiple values

Important note: Check browser compatibilty for destructuring assignment. If you need to support older browsers, see the legacy example.

ECMAScript 6/2015 way

The returning of multiple values is basically just the returning of an object:

Legacy way

The legacy way just uses an array instead of an object:

[sc name=”src” url=”” ]
[sc name=”src” url=”” ]

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.