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: | fluid |
---|---|
Location: | wickliffe, ohio |
Users: | 5 |
Nodes: | 10 (0 / 10) |
Uptime: | 203:16:44 |
Calls: | 50 |
Files: | 15,838 |
Messages: | 50,771 |