Web Scrapers Generator BrowserExt

Operators

Operators are used in the expressions.

Assignment Operator

var = value;

This operator can assign a value to a variable, aray element or a dictionary. var - variable to which value is assigning; value - expression, constant, variable or function call.

Access to an Array or Dictionary Item Operator

var[key]

var - variable of the array or dictionary type, key - the index of the array or dictionary key.

Adding to the End of the Array Operator

var[]

var - array type variable. This operator is used at the left side of the assignment operator.

If an adding variable is an array, then all elements from this array are added by turns to the result array, ie, merge arrays is performed.

To add an array without the merger, it is necessary to wrap it in an array.

The Concatenation Operator

var1 . var2

Connects two strings. Can connect the corresponding elements of string arrays or each element of the array with a single string. In this case, the result will array.

Connect the two arrays:

Connect the array and string or number:

Arithmetic Operators

Used in arithmetic expressions. As well as the concatenation operator can work with arrays. Expressions can use brackets.

+ addition
- subtraction or unary
* multiplication
/ division
% modulo

The simple example:

Increase the value of the array by 20%:

Logical Operators

Used in the logical expressions. The result of logical expression applying is 1 (if the expression is true) or 0 (if the expression is false). Variables or constants of integer or string type can be the operands of logical operators. Expressions can use brackets.

Following table represents logical operators considering operations priority:

! denial
== equal
!= not equal
> greater than
< less than
>= equal to or greater than
<= less than or equal to
&& and
|| or