🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

for-in

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

for-in

Iterate over the own and inherited enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js

1.0.2
latest
Source
npm
Version published
Weekly downloads
14M
-7.39%
Maintainers
2
Weekly downloads
 
Created

What is for-in?

The 'for-in' npm package is a utility that allows you to iterate over the properties of an object in JavaScript. It provides a simple and efficient way to loop through object keys, even for objects that inherit properties from their prototype.

What are for-in's main functionalities?

Iterating over object properties

This feature allows you to loop through each property of an object. The function provided to forIn is called with each property's value and key. This is particularly useful for objects with enumerable properties.

const forIn = require('for-in');
const object = {a: 1, b: 2, c: 3};
forIn(object, function(value, key) {
  console.log(key + ': ' + value);
});

Other packages similar to for-in

Keywords

for

FAQs

Package last updated on 28 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts