Function c__

Captures the input value for the current thread.

If no name is provided, it generates a default name.

c__(x);

c__(x, { name: "var-name" });
c__(x, { name: (index, allowIndex, value) => `${index}` });

[1, 2, 3, 4, 5].map(i => c__(i, { allow: (index, name, value) => index > 2 }));
[10, 20, 30].map(x => c__(x, { allow: (index, name, value) => value === 20 }));

const z = d__(() => c__(outside_1) + y * c__(outside_2) + d__(() => k * c__(inside(5),
{ level: 1 })));
  • Parameters

    • value: any

      The input value to store.

    • Optionalparams: {
          allow?: boolean | ((index: number, name: string, value: any) => any);
          level?: number;
          name?: string | ((index: number, allowIndex: number, value: any) => string);
      }

      Optional parameters object

      • Optionalallow?: boolean | ((index: number, name: string, value: any) => any)

        A function or value to allow tracing the input. allow is called before name. If it returns a boolean, it will allow or disallow respectively. Otherwise it will display the allow result instead of the input value.

      • Optionallevel?: number

        The level number to be used when there is more than one d__ within the same expression or function. Defaults to 0.

      • Optionalname?: string | ((index: number, allowIndex: number, value: any) => string)

        The name of the input. Defaults to i%d where %d is the number of inputs for the thread.

    Returns any

    The input value