Function inScope

  • Check if the value is within the scope

    Parameters

    • val: number
    • scopeValue: number[] = ...

    Returns boolean

    Example

    inScope(0, [0, 1]); // => true
    inScope(1, [0, 1]); // => true
    inScope(2, [0, 1]); // => false
    inScope(-1, [0, 1]); // => false