Ad
  • Custom User Avatar

    How do I start a new clan? Is it just as simple as filling in a new clan name?

  • Custom User Avatar

    I was trying to use .toFixed() or .toPrecision in my answer:

    return (3.141592 * circle.radius * circle.radius).toFixed(6);

    and they throw the error:
    TypeError: circleArea(...).toFixed is not a function
    at Object.handleError
    at ContextifyScript.Script.runInThisContext
    at Object.runInThisContext

    I'm not sure why this is so. My first guess is that because the product is being returned as a string. I tried this as well:

    let area = (3.14 * circle.radius * circle.radius);
    return parseFloat(area).toFixed(6);

    I get the same error.

    I have already peaked at the solutions and only see three instances where these Number methods are being used. All of these have the + operator tacked onto the front with some additional "bits":

    return +(''+(Math.PIc.radiusc.radius).toFixed(6))

    or

    return +(Math.PI * r * r).toFixed(6);

    or

    circleArea=〸=>+(Math.PI〸.radius〸.radius).toFixed(6)

    So I have two questions: Why can't I use .toFixed() as I was attempting to? and, What is the + operator doing here to make .toFixed() work?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution