Skip to content

Instantly share code, notes, and snippets.

@fourstring
Created January 22, 2017 11:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fourstring/081234390c4e31ad1fd48ea46d04385d to your computer and use it in GitHub Desktop.
Save fourstring/081234390c4e31ad1fd48ea46d04385d to your computer and use it in GitHub Desktop.
function compare(firstOperator,secondOperator) {
if (((firstOperator == "+") || (firstOperator=="-")) && ((secondOperator == "*") || (secondOperator=="/"))){
return -1;
} else if ((((firstOperator == "+") || (firstOperator=="-")) && ((secondOperator == "+") || (secondOperator=="-"))) || (
((firstOperator == "*") || (firstOperator=="/")) && ((secondOperator == "*") || (secondOperator=="/")))){
return 0;
} else {
return 1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment