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: | Coz |
---|---|
Location: | Anoka, MN |
Users: | 2 |
Nodes: | 4 (0 / 4) |
Uptime: | 139:51:29 |
Calls: | 166 |
Files: | 5,389 |
Messages: | 223,236 |