Section12 pages
General functions
The JavaScript statements and keywords as Docly runs them — if, switch, try, function, import, typeof and more — and Object.keys/Object.entries.
if(criteria)Evaluates a condition and runs code if it is true. The condition uses standard JavaScript truthiness: false, 0, NaN, "" (empty text), null…elseFor use in if statements, runs code statement or block if criteria evaluates to "false".function name?, params?Declares a function. Functions are closures (they keep access to the variables where they were defined), and parameters can have default…return valueEnds the current function and returns a value to the caller. A bare return; returns undefined.breakEnds the current for, for…of, for…in, while or do…while loop, or a switch statement, and continues with the code after it.continueSkips the rest of the current iteration of a loop (for, for…of, for…in, while, do…while) and continues with the next iteration.typeof valueThe typeof operator returns a string describing the type of the value.switch(value)Runs the code after the case that matches a value — a more readable alternative to a series of if/else statements. HashJS rules: - Each…import filenameImports exported functions and values from another JavaScript file (a module), so they can be used in the current file. Supported forms…try statements, catch, finally?Runs a block of code and catches errors with catch. An optional finally block runs whatever the outcome. The catch variable holds exactly…Object.keys(obj)Returns the names of an object's own properties. Works for object literals, JSON data from documents, and Docly objects such as request…Object.entries(obj)Returns an object's own properties as [key, value] pairs, in the same order as Object.keys(). Works for object literals, JSON data from…