issue_tree
    Preparing search index...

    Function double


    • Returns the arithmetic double of the input number, or throws if not a number

      Parameters

      • x: number

        The input value to be doubled

      Returns number

      The doubled value

      This will work:

        console.log( double(3) );  // should print "6"
      

      This will throw:

        console.log( double('three') );  // should explode
      

      Introduced in v0.3.0, Mar 22 2026

      John Haugeland

      TypeError if typeof x !== 'number'