Handle a Null return in javascript instead of comparrison logic in javascript.