Can reserved keywords like void
be used as object keys in ejs?
I attempted to pass an object containing void
(a JavaScript reserved keyword) as a key within view data.
const viewData = {
void: {
someKey: 'some value',
someOtherKey: 'some other value',
},
}
However, upon trying to access the void
key in ejs like this:
<h3><%= void.someKey %></h3>
An error is thrown:
Unexpected token . in <FILEPATH>
Is there a way to access this void
object in ejs without renaming it? I also attempted using this.void
without success.