In JavaScript, the ______ method is used to iterate over all enumerable properties of an object.
- for loop
- forEach
- while loop
- iterate
The forEach method is used in JavaScript to iterate over all enumerable properties of an object. It is commonly used with arrays to perform an action on each item. The for loop and while loop are general looping constructs and not specific to object iteration. iterate is not a standard method.
Loading...
Related Quiz
- When a Promise is pending and neither fulfilled nor rejected, it is in the ________ state.
- You are creating a build for a production environment and realize that some of the devDependencies are being included in the build, causing it to be bulkier. What steps would you take to rectify this?
- How does the placement of a package in dependencies or devDependencies affect the build process of a project?
- You are building an Express.js API and need to ensure that the API can only be accessed with a valid authentication token. How would you implement middleware to secure your API?
- The ______ script in the package.json file is run after the package is uninstalled and before the package is unpublished.