Ad
  • Custom User Avatar

    The description is just a movie reference. There are no clear directions. Have you read or tried this kata?

  • Custom User Avatar

    And why you say that? Any reasons?

  • Custom User Avatar

    Worst one Ive seen. Should be removed IMO.

  • Custom User Avatar

    Where are you when Im genuinely stumped? :-D

  • Custom User Avatar

    You just discovered closures.

  • Custom User Avatar

    Well, you wrote:

    Mine passed all my tests in chrome, but failed the tests on this site.

    Which led me to conclusion that you need help with your solution. Apparently, you didn't.

  • Custom User Avatar

    My solution DOES work for the input he provided. My argument was (and still is) that (let me quote myself) 'This kata is very badly worded'. As far as Im concerned I did pass it. Youre arguing with me over something you agree with : 'I agree that it is somewhat weirdly explained...'. Why?

  • Custom User Avatar

    Look, I told you why your solution does not work. I agree that it is somewhat weirdly explained in the description of this kata, but this is how it is: your function must accept JavaScript Date() object as the argument, and not an arbitrary string representation of the date. If you want to solve this kata, you have to parse the Date() object that your function received.

    Your solution must return the correct output for this:

    var date = new Date(1964, 10, 13);
    console.log(solution(date));
    
  • Custom User Avatar

    No its not. his own example is

    For example, new Date('06/14/2010') = 5

    and nowhere in his description does he mention the requirement of using Date() object.

    My solution returns the correct number given his input.

  • Custom User Avatar

    The input is a Date() object (https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date), not a string of MM/DD/YYYY format. This is probably the reason why your solution fails.

  • Custom User Avatar

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