Surreal functions are designed to work identically on single elements or arrays of elements. You can use them via method chaining (recommended) or as global functions.
Chaining Style (Recommended):
me().classAdd('red')
Global Function Style:
classAdd(me(), 'red')
Note on Global Conveniences:
By default, Surreal provides global conveniences (like classAdd()) that are attached to the window. If you prefer to avoid global namespace pollution, you can delete globalsAdd() from the source. To use the namespaced version, use surreal.me() or surreal.classAdd().
me().classAdd('red')
any("button").classAdd('red')
me().on("click", ev => me(ev).fadeOut())
any('button').on('click', ev => { me(ev).styles('color: red') })
any('button').run(_ => { alert(_) })
me().styles({ 'color':'red', 'background':'blue' })
me().attribute('active', true)