Re: [csswg-drafts] [css-font-loading] [info discovery] iterable doesn't tell you what index you are at (#6593)

Yeah, `.keys()` produces an iterator for the keys (numeric indexes in this case), `.values()` (the default for arrays) produces just the values, and `.entries()` produces `[index, value]` pairs.

You can then conveniently destructure over them:

```js
for(let [i, v] of palette.entries()) { ... }
```

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6593#issuecomment-917166316 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 10 September 2021 19:45:29 UTC