mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-19 14:13:48 +01:00
10 lines
213 B
JavaScript
10 lines
213 B
JavaScript
|
//Netburner Object helper functions
|
||
|
|
||
|
//Returns the size (number of keys) of an object
|
||
|
function sizeOfObject(obj) {
|
||
|
var size = 0, key;
|
||
|
for (key in obj) {
|
||
|
if (obj.hasOwnProperty(key)) size++;
|
||
|
}
|
||
|
return size;
|
||
|
}
|