Skip to content

Instantly share code, notes, and snippets.

@kevingosse
Created February 10, 2025 18:59
Show Gist options
  • Save kevingosse/2bccf2c439a41fc9ffed9167d2492079 to your computer and use it in GitHub Desktop.
Save kevingosse/2bccf2c439a41fc9ffed9167d2492079 to your computer and use it in GitHub Desktop.
var MODULES = new ActiveXObject("Scripting.Dictionary");
var n; // undefined
MODULES.Add(n, "Test value");
var keys = new VBArray(MODULES.Keys()).toArray();
WScript.Echo("Array length: " + keys.length);
WScript.Echo("Key at index 0: " + (keys[0] === undefined ? "undefined" : keys[0]));
WScript.Echo("Is index 0 enumerable? " + (keys.hasOwnProperty(0) ? "Yes" : "No"));
WScript.Echo("for-in loop:");
for (var index in keys) {
WScript.Echo(" Index: " + index + ", Value: " + keys[index]);
}
WScript.Echo("end");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment