dimanche 3 février 2019

OR condition with EJS?

Both of these statements work:

  <% if(currentUser.collegeLevel === "High School") { %>    
  <h1>  They have a High School Degree </h1>
  <% } %>


  <% if(currentUser.collegeLevel === "Associates Degree") { %>    
  <h1> They have an Associates Degree </h1>
  <% } %>

This statement does NOT work

<% if(currentUser.collegeLevel === "Associates Degree" || "High School") { %>    


 <h1> They have either a High school or Associates Degree</h1>

  <%  } %>

why does the OR function not work?

Aucun commentaire:

Enregistrer un commentaire