Ad
  • Custom User Avatar

    Yeah, that's strange... because I just ran my code in browser and it works great
    Don't know why it returns different arrays here and in my console...
    P.S. And my code works perfectly in Codepen too
    Thanks for the answer anyway, I guess I should just skip this kata..

  • Custom User Avatar

    The question is same.
    My code returns [ "Tablets", "Music CDs", "Speakers" ].
    -Because Speakers goes BEFORE Keyboards.
    -In my answer Speakers goes BEFORE keyboards
    -This is their ORIGINAL positions.
    Why in the world would test expect KEYBOARDS?

  • Custom User Avatar

    So, I have these arguments in my JavaScript function:
    products: [ 'Tablets', 'Computer', 'Vacuum Cleaner', 'Mouses', 'Scooter', 'TVs', 'Speakers', 'Keyboards', 'Printer', 'Games', 'Chargers', 'Cell Phones', 'Music CDs', 'Drones' ]
    amounts: [ 40, 27, 12, 3, 12, 44, 22, 44, 17, 13, 1, 19, 22, 19 ]
    prices: [ 88, 66, 67, 63, 61, 6, 84, 42, 1, 22, 68, 72, 94, 24 ]
    And the test expected [ 'Tablets', 'Music CDs', 'Keyboards' ] to deeply equal [ 'Tablets', 'Music CDs', 'Speakers' ]
    Keyboards and Speakers has the same revenue: 1848, and you requested order them according to their original positions.
    Speakers goes before Keyboards in input parameters. So wtf does this thing want?

  • Custom User Avatar

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