basarat / basarat/typescript-book

Spread parameters

Open
#79 3 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
21.6k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

In the book, this code is demonstrated :

``` ts
function foo(x, y, z) { }
var args = [0, 1, 2];
foo(...args);
```

This is perfectly valid ES6 code, however AFAIK the TS compiler reports an error per https://github.com/Microsoft/TypeScript/issues/5296

Contributor guide

Open the contributing guide

Research direction

Find the book section containing the “Spread parameters” example and review the linked TypeScript issue #5296. Reproduce the snippet with the TypeScript compiler to confirm the reported error, then clarify or correct the example so the documented behavior matches the compiler and ES6 support.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.