I have this code that will get the year from a html form and im trying to set an argument for it but the else statement never seem to execute. Any clue as to why?
exports.printyear = function(request, response) {
let form = new formi.IncomingForm();
form.parse(request, function(error, field, file) {
let year = field.year;
let currenturl = "";
console.log("YEAR");
console.log(year);
if (year === 2007 | 2008 | 2009) {
currenturl = "websiteurl" + year + ".xml";
} else {
currenturl = "websiteurl" + year + ".json";
}
console.log(currenturl);
response.end();
});