Tinderbox v10 Icon

Private functions

From v10.2.0, a private function is a function that can only be called within the note in which it is defined. That note will usually be a library note.

The point of a private function is it allows for the scenario where two (or more) functions might have the same name as might arise if using library notes created by different people. Thus two (or more) library notes can each define private functions with identical names; each library note will use its own version of the private function. As long as functions are labelled private, they will only be callable from their containing note and not from other (library) notes. Be aware that if a note only contains one function it should not be made private—as nothing outside the note can call it.

A function is designated private by inserting the word private between the function's argument parentheses and the curly brace starting the function's code:

function fFunctionName(Args) private { ...code... }

White space(s) before/after the private is optional.