• Oops, I'll mark this as solved then. :

  • those are swapped, as already reported below (years ago)

  • area_code: Returns an area code from the number. The area code will be 3 digits.

    Yeah, sure.
    I'm not extremely sure what's wrong here, though. It may be that expected and actual are swapped, or it's just that the kata is broken.

  • Tests are not actually displaying the expected answer.
    '1234567890' should equal <bound method Phone.number of <solution.Phone object at 0x7fa358dfd5e0>>
    Please fix.

  • Marking it as solved, already did both.

  • Marking it as solved because it's no longer in the kata.

  • Added

  • The value it returns is b, of course, but the reference it returns is a. This matters if a is an object or a property of one.

    I can't tell you offhand why your solution isn't working; possibly the mechanism is different within a setter. But, frankly, I think that's your problem. If I knew, I would gladly tell you, but seeing as I don't, I'm not making your problem mine. Both Alex' and my solution handle this correctly, as far as I can see, so it's not impossible.

  • Not sure how this would be possible, I tried to return the expression itself but that doesn't work.
    Also, a = b returns b and not undefined, or am I missing something?

  • Fixed the description.

  • a = b should return a ( with its new value ) in JS. The reference solution doesn't seem to do this and I haven't checked if this is tested. Existing programs sometimes rely on this; it is not good practice to return undefined for this expression even if the side effect is handled correctly.

  • Description still doesn't specify what the initial values in a new typedObject shall ( or can ) be.

  • pass the value y to that constructor

    This explicitly requires Array(1) to result in [ <1 empty value> ] instead of [ 1 ]. The wording here should be just a little less positive and unambiguous; the required value should be an instance of the constructor containing the new value. The current specs and example are therefore inconsistent ( and the spec should be leading, which it isn't ).

  • examples with this in the description would be cool too:

    However, if property x is reassigned again with a new value z convert z to the initial type again and assign it to x.
    Also: Don't allow new properties being added to the object.
    Bonus: Try not to completely hardcode your solution. Not hardcoding it is what makes it challenging.

  • Loading more items...