DEV Community

Cover image for JavaScript Interview Question #37: What's the type of a single argument provided to the split function?
Coderslang: Become a Software Engineer
Coderslang: Become a Software Engineer

Posted on • Originally published at learn.coderslang.com on

JavaScript Interview Question #37: What's the type of a single argument provided to the split function?

js-test-37

What's the output?

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

In this code snipped, all the arguments provided to the function split will be collected and placed in a single array args.

The fact that we provide a single argument hello, doesn’t change the expected behavior.

As all arrays are objects in JavaScript, we’ll see the string object printed to the console.


ANSWER: the output will be object.

Learn Full-Stack JavaScript

Top comments (0)