Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated for to for..of #18696

Merged
merged 7 commits into from
Jul 25, 2022
Merged

Updated for to for..of #18696

merged 7 commits into from
Jul 25, 2022

Conversation

PrajwalBorkar
Copy link
Contributor

Summary

Motivation

Supporting details

Related issues

Part of #18103

Metadata

  • Adds a new document
  • Rewrites (or significantly expands) a document
  • Fixes a typo, bug, or other error

@PrajwalBorkar PrajwalBorkar requested a review from a team as a code owner July 23, 2022 18:24
@PrajwalBorkar PrajwalBorkar requested review from jpmedley and removed request for a team July 23, 2022 18:24
@github-actions github-actions bot added the Content:WebAPI Web API docs label Jul 23, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jul 23, 2022

Preview URLs

Flaws

Note! 3 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Web/API/CSS_Typed_OM_API/Guide
Title: Using the CSS Typed Object Model
on GitHub
Flaw count: 2

  • macros:
    • /en-US/docs/Web/API/Object/toString does not exist
  • broken_links:
    • Link points to the page it's already on

External URLs

URL: /en-US/docs/Web/API/CSS_Typed_OM_API/Guide
Title: Using the CSS Typed Object Model
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/Clients/matchAll
Title: Clients.matchAll()
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/Client/url
Title: Client.url
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/crypto_property
Title: self.crypto
on GitHub

No new external URLs

(this comment was updated 2022-07-24 07:27:32.369712)

@PrajwalBorkar
Copy link
Contributor Author

PrajwalBorkar commented Jul 23, 2022

clients.matchAll(options).then(function(clientList) { for (var i = 0 ; i < clientList.length ; i++) { if (clientList[i].url === 'index.html') { clients.openWindow(clientList[i]); // or do something else involving the matching client } } });
Should I update this code as per this comment @Josh-Cena ?

@lionralfs
Copy link
Contributor

clients.matchAll(options).then(function(clientList) { for (var i = 0 ; i < clientList.length ; i++) { if (clientList[i].url === 'index.html') { clients.openWindow(clientList[i]); // or do something else involving the matching client } } });
Should I update this code as per this comment

Looks like you can do:

clients.matchAll(options).then(function(clientList) {
  for (const client of clientList) {
    if (client.url === 'index.html') {
      clients.openWindow(client);
      // or do something else involving the matching client
    }
  }
});

for (let i = 0; i < array.length; i++) {
randText.textContent += `${array[i]} `;
}
randText.textContent = `The random numbers are: ${array.join(" ")}`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've refactored it further. This one needs to be backported to the live examples.

@jpmedley jpmedley merged commit 5dd98e7 into mdn:main Jul 25, 2022
@PrajwalBorkar PrajwalBorkar deleted the prajwal-js branch July 25, 2022 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants