Reason for the order of else if / if else statements


What is the precise reasoning behind using the unusual order of these if / else if / if else statements? At the beginning of the lesson, if else and else if statements seemed standard. Now the order and use seem arbitrary. I just would like to know how this is the best order.
Thank you.

var compare = function(userChoice, computerChoice) {
if (userChoice === computerChoice) {
    return "The result is a tie";
else if (userChoice === "rock") {

    if (computerChoice === "scissors")
        return "rock wins";
    else {
        return "paper wins";


To get an idear
Please read
and concentrate on:

  • the creation of the compare function
  • the truth-table
  • the build of the IF ELSE-IF statement structure as part of the compare FUNCTION-BODY
  • the execution of the compare function (keeping in mind that the return statement is used )