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;