Changing the view based on these if/else statements
First step, remove that first else 

if (typeof response !== 'string') { 
    mode = edit; 
} else if (status.indexOf('Completed') !== -1) { 
    mode = display; 
} else if ((stage &lt;= isEditable) &amp;&amp; (code == 0 || code == 2)) { 
    mode = edit; 
} else { 
    mode = display; 
}


After this, your text and your code dont look the same to me... you need better variables or having methods:

var noResponse = typeof response !== 'string';
var statusIsNotCompleted = status.indexOf('Completed') !== -1;
var stageIsEditable = (stage &lt;= isEditable) &amp;&amp; (code == 0 || code == 2);
if (noResponse) { 
    mode = edit; 
} else if (statusIsNotCompleted) { 
    mode = display; 
} else if (stageIsEditable) { 
    mode = edit; 
} else { 
    mode = display; 
}


After this, is there an option in real life where putting else if (stageIsEditable) before else if (statusIsNotCompleted) make something not work? Otherwise, you could join them in a variable:

var yourThingIsEditable = noResponse ||  stageIsEditable;