I have an API request that returns what should be visible on the page, it works great. My question is if nothing is returned, how do I set a default?
Does this help? I use it in mapping click the green js
var tweet = value;
var boro = tweet.substring(0, 7);
if (boro === 'MAN ALL') {
output = '"0"';
}
else if (boro === 'BKLYN A') {
output = '"9"';
}
else if (boro === 'BX ALL ') {
output = '"8"';
}
else if (boro === 'QNS ALL') {
output = '"7"';
}
else if (boro === 'SI ALL ') {
output = '"6"';
}
else if (boro === 'MAN 2-A') {
output = '"5"';
}
else if (boro === 'BKLYN 2') {
output = '"4"';
}
else if (boro === 'BX 2-AL') {
output = '"3"';
}
else if (boro === 'QNS 2-A') {
output = '"2"';
}
else if (boro === 'SI 2-AL') {
output = '"1"';
}
return output;
Thanks so much, I didn't realize that the var value was what being passed.