JavaScript Cheat Sheet
Last updated
Last updated
This cheat sheet serves as a quick reference for common JavaScript scripting tasks, focusing on enhancing your bot interactions and automation processes. It covers a range of topics from basic value checks to complex pattern validation.
return
Statements: No return statement is needed to return a storage variable to a block. Unless you define a whole function inside the block, Parloa will return the last variable it "saw". Using a return statement outside of a function to return something to the block will result in an error.
Condition Blocks: Function on the if / else if / else principle line by line. The if/else is already built-in â each space in the block is only the code/condition that should evaluate to true or false.
Variable Initialization: If your code requires creating (initializing) a JS variable, do it inside a function. If your call flow loops back, or if you try to use the same variable name later, Parloa will throw an error.
Instead of doing this:
Do this:
Please refer to the Using Regular Expressions (Regex) page.