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: | Kurt Hamm |
---|---|
Location: | Columbia, SC |
Users: | 8 |
Nodes: | 20 (0 / 20) |
Uptime: | 134:40:08 |
Calls: | 2,804 |
Calls today: | 1 |
Files: | 64 |
Messages: | 854,503 |