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: | Xerxes |
---|---|
Location: | Azle, Texas |
Users: | 131 |
Nodes: | 10 (0 / 10) |
Uptime: | 94:07:12 |
Calls: | 3,190 |
Calls today: | 1 |
Files: | 195 |
U/L today: |
0 files (0K bytes) |
D/L today: |
0 files (0K bytes) |
Messages: | 366,142 |
Posted today: | 0 |