syntax error: missing ) after argument list while compiling ejs

i am a student trying to run this code on the ide lab environment, but it keeps showing me an error, but i can't find where i went wrong. It keeps showing me the same error, i have read through the whole code but still don't see any missing syntax. error message Here's the ejs that causes errors. What is the problem with this code?

    <meta charset="UTF-8">
<label for="heat">Temperature related devices</label>
<table id="heat">
    <tr>
        <td>ID</td>
        <td>Type</td>
        <td>Status</td>
        <td>State</td>
        <td>Temperature</td>
        <td>Select this device</td>
        <td>Delete this device</td>
    </tr>
    <% myDevices.forEach(function(item) { %>
        <% if(field.name == "Heater" || field.name == "Dishwasher" || field.name == "Refrigerator - Freezer" || field.name == "Oven" || field.name == "Microwave Oven" || field.name == "Steamer Oven") { %>            <tr>
                <td><%= item.id %></td>
                <td><%= item.name %></td>
                <td><%= item.status %></td>
                <td><%= item.state %></td>
                <td><%= item.temperature %></td>
                <td><a href="/updateDeviceStatus?id=<%= item.id %>">Edit this device</a></td>
                <td><a href="/deleteDevice?id=<%= item.id %>" onClick="return confirm('Are you sure?')">Delete this device</a></td>
            </tr>
        <% } %>
    <% }) %>
</table>
<br><br>
<label for="volume">Sound related devices</label>
<table id="volume">
    <tr>
        <td>ID</td>
        <td>Type</td>
        <td>Status</td>
        <td>State</td>
        <td>Volume</td>
        <td>Select this device</td>
        <td>Delete this device</td>
    </tr>
    <tr>
    <% myDevices.forEach(function(item) { %>
        <% } else if(field.name == "Music Player" || field.name == "Television" || field.name == "Radio") { %>            <tr>
                <td><%= item.id %></td>
                <td><%= item.name %></td>
                <td><%= item.status %></td>
                <td><%= item.state %></td>
                <td><%= item.volume %></td>
                <td><a href="/updateDeviceStatus?id=<%= item.id %>">Edit this device</a></td>
                <td><a href="/deleteDevice?id=<%= item.id %>" onClick="return confirm('Are you sure?')">Delete this device</a></td>
            </tr>
        <% } %>
    <% }) %>
    </tr>
</table>
<br><br>
<label for="speed">Speed related devices</label>
<table id="speed">
    <tr>
        <td>ID</td>
        <td>Type</td>
        <td>Status</td>
        <td>State</td>
        <td>Speed</td>
        <td>Select this device</td>
        <td>Delete this device</td>
    </tr>
    <tr>
    <% myDevices.forEach(function(item) { %>
        <% } else if(field.name == "Hob" || field.name == "Fan") { %>            <tr>
                <td><%= item.id %></td>
                <td><%= item.name %></td>
                <td><%= item.status %></td>
                <td><%= item.state %></td>
                <td><%= item.speed %></td>
                <td><a href="/updateDeviceStatus?id=<%= item.id %>">Edit this device</a></td>
                <td><a href="/deleteDevice?id=<%= item.id %>" onClick="return confirm('Are you sure?')">Delete this device</a></td>
            </tr>
        <% } %>
    <% }) %>
    </tr>
</table>
<br><br>
<label for="speedTemperature">Speed & Temperature related devices</label>
<table id="speedTemperature">
    <tr>
        <td>ID</td>
        <td>Type</td>
        <td>Status</td>
        <td>State</td>
        <td>Speed</td>
        <td>Temperature</td>
        <td>Select this device</td>
        <td>Delete this device</td>
    </tr>
    <tr>
    <% myDevices.forEach(function(item) { %>
        <% } else if(field.name == "Air-Conditioner" || field.name == "Heat Pump Tumble Dryer" || field.name == "Washing Machine") { %>            <tr>
                <td><%= item.id %></td>
                <td><%= item.name %></td>
                <td><%= item.status %></td>
                <td><%= item.state %></td>
                <td><%= item.speed %></td>
                <td><%= item.temperature %></td>
                <td><a href="/updateDeviceStatus?id=<%= item.id %>">Edit this device</a></td>
                <td><a href="/deleteDevice?id=<%= item.id %>" onClick="return confirm('Are you sure?')">Delete this device</a></td>
            </tr>
        <% } %>
    <% }) %>
    </tr>`enter code here`
</table>
<br><br>
<label for="intensity">Intensity related devices</label>
<table id="intensity">
    <tr>
        <td>ID</td>
        <td>Type</td>
        <td>Status</td>
        <td>State</td>
        <td>Intensity</td>
        <td>Select this device</td>
        <td>Delete this device</td>
    </tr>
    <tr>
    <% myDevices.forEach(function(item) { %>
        <% } else if(field.name == "Air-Conditioner" || field.name == "Heat Pump Tumble Dryer" || field.name == "Washing Machine") { %>            <tr>
                <td><%= item.id %></td>
                <td><%= item.name %></td>
                <td><%= item.status %></td>
                <td><%= item.state %></td>
                <td><%= item.intensity %></td>
                <td><a href="/updateDeviceStatus?id=<%= item.id %>">Edit this device</a></td>
                <td><a href="/deleteDevice?id=<%= item.id %>" onClick="return confirm('Are you sure?')">Delete this device</a></td>
            </tr>
        <% } %>
    <% }) %>
    </tr>
</table>
<br><br>
<label for="NA">Other devices</label>
<table id="NA">
    <tr>
        <td>ID</td>
        <td>Device type</td>
        <td>Device status</td>
        <td>Device state</td>
        <td>Select this device</td>
        <td>Delete this device</td>
    </tr>
    <tr>
    <% myDevices.forEach(function(item) { %>
        <% } else if(field.name == "Door" || field.name == " Blinds" ||  field.name == "Curtains" || field.name == " Automated Laundry Rack ") { %>
            <tr>
                <td><%= item.id %></td>
                <td><%= item.name %></td>
                <td><%= item.status %></td>
                <td><%= item.state %></td>
                <td><a href="/updateDeviceStatus?id=<%= item.id %>">Edit this device</a></td>
                <td><a href="/deleteDevice?id=<%= item.id %>" onClick="return confirm('Are you sure?')">Delete this device</a></td>
            </tr>
        <% } %>
    <% }) %>
    </tr>
</table>

starting at L40 there's <% } else if( throughout:

<% myDevices.forEach(function(item) { %>
    <% } else if(field.name == "Music Player" || field.name == "Television" || field.name == "Radio") { %> 

First loop doesn't have it, i.e. has only a single if so I guess removing } else should do it