I have created REST API using node.js.since the API consumer is not correctly populating the object & some of the object attributes are coming "undefined"
and sometimes undefined
.
I have added a request interceptor that rejects API request if the required request parameters are missing
this is how my code looks like today. I just want to check if there is any better way to handle it.
(!variable_name || variable_name === 'undefined')