question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow ArrayLike as a spread source

See original GitHub issue

When trying to pass caller arguments to another function with ...arguments the compiler complains with Type 'IArguments' is not an array type. Version 1.8.9.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:5
  • Comments:27 (19 by maintainers)

github_iconTop GitHub Comments

3reactions
vitaly-tcommented, Feb 26, 2018

So, to clarify, as of this day it still doesn’t work, and the reason being - it doesn’t work in FireFox.

In the meantime, all our Node.js code in JavaScript uses arguments for spread operator without any issues, but the TypeScript can’t/won’t do it regardless, for compatibility with FireFox.

Shouldn’t support for spread of array-like objects become the default at this point, or at least default when building for the server-side?

3reactions
kitsonkcommented, Dec 29, 2017

@aaronresnick as mentioned in the PR text, when targeting ES3/ES5 you have to use --downlevelIteration. Are you using that?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spread syntax (...) - JavaScript - MDN Web Docs - Mozilla
The spread (...) syntax allows an iterable, such as an array or string, to be expanded in places where zero or more arguments...
Read more >
Why do you need to know about Array-like Objects?
In this article, we will learn about JavaScript array-like objects ... We are using the spread operator on arguments and are now allowed...
Read more >
Spread Syntax ES6 - javascript
Spread allows sugared syntax on top of more clunky direct array ... symbol to iterate through Arrays and Array-like Objects like :.
Read more >
Understanding JavaScript spread and rest syntax
This means that, while we can use spread to pass a dynamic number of function arguments, our function isn't dynamic enough yet to...
Read more >
6 Use Cases of Spread with Array in JavaScript
MDN: Spread syntax allows an iterable such as an array expression or string to ... MDN: arguments is an Array-like object accessible inside ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found