Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "utils/eval/docs/types/index.d"

Index

Functions

Functions

Export assignment evil

  • evil(str: string): any
  • Alias for eval global.

    Notes

    • A reference to eval is treated differently by the compiler. For example, when evaluating code containing block-scoped declarations (e.g., let, const, function, class), the compiler may throw an error complaining that block-scoped declarations are not yet supported outside of strict mode. One possible workaround is to include "use strict"; in the evaluated code.

    Parameters

    • str: string

      code to evaluate

    Returns any

    returned value if applicable

    Example

    var v = evil( '5*4*3*2*1' );
    // returns 120