var names = {
AI:"Anguilla", ... };
for(var i = 0; i <= names.length; i++) {
Re: Match getstr() to object
By: Ephram to All on Thu Jun 04 2020 11:53:48
var names = {
AI:"Anguilla", ... };
for(var i = 0; i <= names.length; i++) {
'names' is an Object, but you're treating it like an Array.
You could try something like:
for (var name in names) {
// eg. name === 'AI' and names[name] === 'Anguilla'
}
Or something like:
var keys = Object.keys(names);
for (var i = 0; i < keys.length; i++) {
// eg. keys[i] === 'AI' and names[keys[i]] === 'Anguilla'
}
Or something like:
Object.keys(names).forEach(function (e) {
// eg. e == 'AI' and names[e] === 'Anguilla'
});
echicken
Sysop: | digital man |
---|---|
Location: | Riverside County, California |
Users: | 1,043 |
Nodes: | 15 (0 / 15) |
Uptime: | 41:57:52 |
Calls: | 500,899 |
Calls today: | 2 |
Files: | 109,370 |
D/L today: |
4,738 files (491M bytes) |
Messages: | 304,224 |