arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

Function include

circle-info

This article is automatically translated from Russian by Google Translator.

hashtag
Function description

Allows you to use functions implemented by the user in other files. It is supposed to write your own libraries.

As a passed parameter you must specify the full system path to the file with the required functions or the name of the file. In the second case, the file for a connection must be in the same directory as the main file in which include is called.

hashtag
Function call

other_file.js
// Functions must be declared as global variables
sum = function(a, b) {
    return a + b;
}
include("other_file.js");
print(sum(1, 2));