How can I tell if user is moving to next or previous stage of business process flow when OnStageChange event is fired in Dynamic 365 Online?

I’m writing a JS script to intercept and do some additional validations when user moved to the next stage of business process flow in Dynamic 365 Online.

I’m binding my function to OnStageChange event of Dynamic 365, but that event is not only fired when a user moved to next stage but also when he moved back to previous stage as well.

Is the any way to tell if the user is moving to the next or the previous stage?