Syntax error with Evaluate JavaScript

This is interesting. According of this user guide paragraph, Evaluate can be used with JavaScript? I even found some other examples of Evaluate JavaScript in this forum.
https://marketsquare.github.io/robotframework-browser/Browser.html#Evaluate%20JavaScript

And here is a forum post, suggesting Evaluate JavaScript, to get text from an element…