Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
How do I start a new clan? Is it just as simple as filling in a new clan name?
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?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution