mardi 5 septembre 2017

why this if else statement not working - kettle javascript [duplicate]

This question already has an answer here:

I am using this java script in my kettle spoon ETL workflow. But always only the if statement is working, else if is not working, whats wrong with this?

var type1 = '';
var type2 = '';
var category1 = [1, 2, 3, 4, 5, 6, 7, 8, 50, 53];
var category2 = [10, 11, 12, 13, 14, 15, 56];

if (sub_type_id in category1) {
type1 = 'type-res';}
else if (sub_type_id in category2) {
type1 = 'type-ren';}
else type1 = '';

Aucun commentaire:

Enregistrer un commentaire