error Expected an assignment or function call and instead saw an expression
Why does recursion always report errors and cannot run?
Now there are two ways to deal with it
1. Add a return before the expression
res.data.forEach(item =>
item.attr_vals.length === 0 ?[] : item.attr_vals.split(' ')
)
2. Remove curly braces
res.data.forEach(item => {
returnitem.attr_vals.length === 0 ?[] : item.attr_vals.split(' ')
}
)
Read More:
- error C2057: expected constant expression (Can the size of an array in C language be defined when the program is running?)
- A call to an OS function failed
- [Qt] error: call to non-static member function without an object argument
- An undetermined call to function ‘shell’: missing ‘. Stop. Problem encountered when using shell command in makefile
- When the mybatis field contains an expression, an error is reported when it is stored in the database
- Arrow function should not return assignment no-return-assign
- JS uses the and or operator, and an error is reported: uncaught rangeerror: maximum call stack size exceeded
- Using the decorator may prompt property assignment expected. Vetur (1136)
- How to Fix Parser rerror: error tokenizing data. C error: expected 2 fields in line 53, saw 3
- Expected primary expression before ‘unsigned’ solution
- [OpenGL · error] visual studio 2019 reports an error. It is an external symbol gladloadglloader that cannot be parsed. This symbol is referenced in the function main
- TypeError: An asyncio.Future, a coroutine or an awaitable is
- Error: more than one row returned by a subquery used as an expression
- Vue reports an error sasserror: expected newline
- JAVA lambda Syntax error on tokens, Expression expected instead
- Python problem: indenta tionError:expected an Error resolution of indented block
- Python TypeError: ‘newline’ is an invalid keyword argument for this function
- error: aggregate value used where an integer was expected
- Ant Design ‘cross env’ is not an internal or external command, nor is it an error reporting problem for a runnable program
- Syntax Error: SassError: Invalid CSS after “…-height: #{math“: expected expression (e.g. 1px, bold