U
U
urajo2019-12-19 15:57:20
Node.js
urajo, 2019-12-19 15:57:20

Why doesn't for work in ejs?

SyntaxError: Unexpected token 'for' in /var/www/html/app/views/index.ejs while compiling ejs

Writes this error if I try to for in an object
The code itself
<p><%= for(var i in table){
  i
} %></p>

The object I get is like this, I want to turn to the suburban one (and other elements at this level, if any)
{
  'Загородное': {
    'Администрация': [
      [pnd_1], [pnd_1], [pnd_1],
      [pnd_1], [pnd_1], [pnd_1],
      [pnd_1], [pnd_1], [pnd_1],
      [pnd_1], [pnd_1], [pnd_1],
      [pnd_1], [pnd_1], [pnd_1],
      [pnd_1], [pnd_1], [pnd_1],
      [pnd_1]
    ]
  }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SagePtr, 2019-12-19
@urajo

Sign = before for is superfluous

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question