https://netsuiteprofessionals.com logo
k

karlenigma

03/05/2018, 4:46 PM
Is there a better way of doing the below??
Copy code
if (!ORnewline && NRnewline) {
    		    		categories.push(13); // => add option with ID 13 New Line to the list.
    		    	} else {
    		    		categories = categories.filter(function (n) { return (n != 13); });
    		    	}
    				
    				if (!ORclearanceline && NRclearanceline) {
    		    		categories.push(20); // => add option with ID 20 Clearance Lines to the list.
    		    	} else {
    		    		categories = categories.filter(function (n) { return (n != 20); });
    		    	}
    		    	
    		    	if (!ORspecial && NRspecial) {
    		    		categories.push(17); // => add option with ID 17 Special Lines to the list.
    		    	} else {
    		    		categories = categories.filter(function (n) { return (n != 17); });
    		    	}