Ejs- node-javascript

<% if(items.length ){ %>
                        <h1> empty cart </h1  > <% }} %>

the above code is in my checkout .ejs file


this is my .js file in node . cart is an array in this file.
items is the argument which i have passed in my .js file while rendering

everything is working fine in my project. but when i add that above code .it shows this error.
i want to implement with the code that when my items. length is empty a heading show that “cart is empty”.

when i run the following error gets

SyntaxError: Missing catch or finally after try in C:\Users\AMIT SINGH\Desktop\music cart\views\checkout.ejs while compiling ejs

If the above error is not helpful, you may want to try EJS-Lint:
Or, if you meant to create an async function, pass async: true as an option.
    at new Function (<anonymous>)
    at Template.compile (C:\Users\AMIT SINGH\Desktop\music cart\node_modules\ejs\lib\ejs.js:618:12)
    at Object.compile (C:\Users\AMIT SINGH\Desktop\music cart\node_modules\ejs\lib\ejs.js:389:16)
    at handleCache (C:\Users\AMIT SINGH\Desktop\music cart\node_modules\ejs\lib\ejs.js:212:18)
    at tryHandleCache (C:\Users\AMIT SINGH\Desktop\music cart\node_modules\ejs\lib\ejs.js:251:16)
    at View.exports.renderFile [as engine] (C:\Users\AMIT SINGH\Desktop\music cart\node_modules\ejs\lib\ejs.js:482:10)
    at View.render (C:\Users\AMIT SINGH\Desktop\music cart\node_modules\express\lib\view.js:135:8)
    at tryRender (C:\Users\AMIT SINGH\Desktop\music cart\node_modules\express\lib\application.js:640:10)
    at Function.render (C:\Users\AMIT SINGH\Desktop\music cart\node_modules\express\lib\application.js:592:3)
    at ServerResponse.render (C:\Users\AMIT SINGH\Desktop\music cart\node_modules\express\lib\response.js:1008:7)

please help

Hello Amit,

Please edit your post, and select the code section you added, then ctrl + shift + C , so we can see your code.
Thank you.

thank you i just edited

This is the full code?

I see an extra } after if's close }.

You may please share the full code.

Please post your full project repository.

hey i have mentioned all in detail now

hey guess you already told whats wrong. thats the extra } . thanks

To do list <%_ if (kindOfDay === "saturday" || kindOfDay === "sunday") { _%>

style="color: blue" ><%= kindOfDay %> to Do list

<%_ } else { _%>

style="color: red"><%= kindOfDay %> to Do list


//i have the same error, could you help me please!//