Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

751
Views
SyntaxError: Token inesperado 'for' en I:\Curso completo de desarrollo web\EJS\To Do List\views\list.ejs al compilar ejs

He estado intentando crear una lista de tareas pendientes usando ejs y aplicándola en html. Pero al no poder obtener el resultado.

Fragmento de código:

 <ul> <li>Food Items</li> <li>Play Cricket</li> <li>Learn To code</li> <li>Apply for jobs</li> <li>Play game of Chess</li> <% for(int i = 0;i<new_item.length;i++) %> <% { %> <li> <%= new_item %> </li> <% } %> </ul>

Error al obtener:

 SyntaxError: Unexpected identifier in I:\Complete Web Development Course\EJS\To Do List\views\list.ejs while compiling ejs If the above error is not helpful, you may want to try EJS-Lint: https://github.com/RyanZim/EJS-Lint Or, if you meant to create an async function, pass `async: true` as an option. at new Function (<anonymous>) at Template.compile (I:\Complete Web Development Course\EJS\To Do List\node_modules\ejs\lib\ejs.js:673:12) at Object.compile (I:\Complete Web Development Course\EJS\To Do List\node_modules\ejs\lib\ejs.js:398:16) at handleCache (I:\Complete Web Development Course\EJS\To Do List\node_modules\ejs\lib\ejs.js:235:18) at tryHandleCache (I:\Complete Web Development Course\EJS\To Do List\node_modules\ejs\lib\ejs.js:274:16) at View.exports.renderFile [as engine] (I:\Complete Web Development Course\EJS\To Do List\node_modules\ejs\lib\ejs.js:491:10) at View.render (I:\Complete Web Development Course\EJS\To Do List\node_modules\express\lib\view.js:135:8) at tryRender (I:\Complete Web Development Course\EJS\To Do List\node_modules\express\lib\application.js:657:10) at Function.render (I:\Complete Web Development Course\EJS\To Do List\node_modules\express\lib\application.js:609:3) at ServerResponse.render (I:\Complete Web Development Course\EJS\To Do List\node_modules\express\lib\response.js:1039:7)
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

for(int i = 0;i<new_item.length;i++)

int no es una declaración de tipo válida en ejs, por lo que debe usar let o var en su lugar.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!