• Return a value that alternates between 0 and length. https://www.desmos.com/calculator/vcsjnyz7x4

    Parameters

    • x: number

      Input the value to pingpong.

    • length: number = 1

      The positive value the function will pingpong to. Default is 1.

    Returns number

    Return a value that alternates between 0 and length : Float.