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.
This comment is hidden because it contains spoiler information about the solution
Are you sure?
Shouldn't you not be accessing private variables in prototype methods? I'm curious as to how you formatted your first solution since locally scoped variables aren't accessible in methods defined in the prototype.
This comment is hidden because it contains spoiler information about the solution
In my opinion it is not just preference. At least not when you try to write code which most clearly conveys what it is supposed to do. In this case we want to know if every element in an array is an integer. Afterwards, it's just micro optimization I'd say. (I.e. if you have an every implementation that continues after the predicate returns false, than fix the implementation in stead of working around).
It would be better to test if weight is defined in the setter of the property, not in the constructor :
var myCat = new Cat("garfield",150);
myCat.weight = null; //should throw an error
This comment is hidden because it contains spoiler information about the solution
I'll move it to a 6 kyu...
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I agree, though it's a consequence of the age of this kata. I don't think I have any way of changing its rating.
I think this kata isn't
4 kyu
, maximum:6 kyu
or7 kyu
.This comment is hidden because it contains spoiler information about the solution
Feature Request: Edit submitted solution.
It's kind a strange that I can't edit submitted solution. Even if we have sometime for "refactor" before final submission - yeah, but nevertheless I made typo and want to fix it.
This isn't a good test assertion. To complete this test you need to define getter/setter on every instance (which is bad) instead of defining these getter/setter once on
Cats.prototype
.So please change this test assertion to
Test.expect(Object.getOwnPropertyDescriptor(Cat.prototype, 'weight').get);
Loading more items...