
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are async generator methods in JavaScript?
Async generator functions are the same like generator function. The async generator functions will return an object, whereas an async generator whose methods such as next, throw and return promises for { value, done }, instead returning directly.
Example
Here’s an example from GitHub showing function returning async generator object −
async function* readLines(path) { let file = await fileOpen(path); try { while (!file.EOF) { yield await file.readLine(); } } finally { await file.close(); } }
- Related Questions & Answers
- What are async methods in JavaScript?
- What are generator functions in JavaScript?
- What are Async Streams in C# 8.0?
- JavaScript Generator
- What are the Important Array Methods in JavaScript?
- Async/Await Functions in JavaScript
- What are Hierarchical Methods?
- What are methods in Java?
- Explain Generator functions in JavaScript?
- Random color generator in JavaScript
- What are the methods of a boolean object in JavaScript?
- What are the methods of an array object in JavaScript?
- What are defender methods or virtual methods in Java?
- What are jQuery string methods?
- What are Event Methods in jQuery?
Advertisements