• Sign Up
    Time to claim your honor
  • Training
  • Practice
    Complete challenging Kata to earn honor and ranks. Re-train to hone technique
  • Freestyle Sparring
    Take turns remixing and refactoring others code through Kumite
  • Community
  • Leaderboards
    Achieve honor and move up the global leaderboards
  • Chat
    Join our Discord server and chat with your fellow code warriors
  • Discussions
    View our Github Discussions board to discuss general Codewars topics
  • About
  • Docs
    Learn about all of the different aspects of Codewars
  • Blog
    Read the latest news from Codewars and the community
  • Log In
  • Sign Up
LibraZilver Avatar
Name:LibraZilver
Clan:Unknown
Member Since:Jul 2017
Last Seen:Jul 2024
Profiles:
Following:11
Followers:5
Allies:3
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (25)
  • Replies
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • Hdeen
    • commented on "Return the day " javascript solution
    • 5 months ago

    It's clean but it's an overkill and it'll be a bit slow too because of handling month and year.

  • Custom User Avatar
    • AlexRz912
    • commented on "Working with arrays I (and why your code fails in some katas)" javascript solution
    • 13 months ago

    Aight, thx for the answers. I'll need to read all that quite a few times and let it cook a little.

  • Custom User Avatar
    • JohanWiltink
    • commented on "Working with arrays I (and why your code fails in some katas)" javascript solution
    • 13 months ago

    You have the correct idea about deep ( or maybe shallow, see above ) copies and mutating the array itself.

    Documentation can tell you which methods work by mutation and which by returning a new value.

    Mutating input values will mutate it at the called site as well as at the call site, which is dangerous in general and will explicitly fail you in this kata.

    Look into the difference between "pure code" and "programming by side effect". Impure code is the source of a lot of very preventable bugs.

  • Custom User Avatar
    • AlexRz912
    • commented on "Working with arrays I (and why your code fails in some katas)" javascript solution
    • 13 months ago

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

  • Custom User Avatar
    • JohanWiltink
    • commented on "Working with arrays I (and why your code fails in some katas)" javascript solution
    • 13 months ago

    I don't know Java ( at all. but I had just seen the term "arrayList" in a Java context ), and I don't understand exactly what your problem is. I'd love to help you, but "I don't understand the mechanism" doesn't tell me what you are not understanding.

  • Custom User Avatar
    • AlexRz912
    • commented on "Working with arrays I (and why your code fails in some katas)" javascript solution
    • 13 months ago

    My bad, I initially thought js builtins arrays was some kind of improved arrayList.
    Then, I don't understand the mechanism at all, even after looking at the docs for js arrays or the solutions to this kata.

  • Custom User Avatar
    • JohanWiltink
    • commented on "Working with arrays I (and why your code fails in some katas)" javascript solution
    • 13 months ago

    JavaScript is not Java. JS does not have Lists or ArrayLists. JS Arrays are fully dynamic; there is no size limit at any time ( apart from a general maximum size of ridiculous ).

  • Custom User Avatar
    • AlexRz912
    • commented on "Working with arrays I (and why your code fails in some katas)" javascript solution
    • 13 months ago

    This kata is so confusing tbh, what I understand is there's a max limit to the initial number of values of an array (normal, it's an arrayList).
    But usually arrayLists in js (arrays) resize automatically if the number of values is bigger than the inital max value no ? Even after seeing the doc, I still don't get the mechanism behind it.

  • Custom User Avatar
    • JohanWiltink
    • commented on "Working with arrays I (and why your code fails in some katas)" javascript solution
    • 13 months ago

    Your own test code is irrelevant then; it's testing the wrong thing(s). Try

    let xs = [1];
    void withoutMax(xs);
    assert.deepEqual(xs,[1]);
    
  • Custom User Avatar
    • Eric_DiMarzio
    • commented on "Working with arrays I (and why your code fails in some katas)" javascript solution
    • 13 months ago

    The error in which a random array of values doesn't return the array without the last value. I'm not sure what's going on under the hood of the codewars random array testing. I can't get any of my own test code to return the error given the same input.

  • Custom User Avatar
    • trashy_incel
    • commented on "Working with arrays I (and why your code fails in some katas)" javascript solution
    • 13 months ago

    which error ?

  • Custom User Avatar
    • Eric_DiMarzio
    • commented on "Working with arrays I (and why your code fails in some katas)" javascript solution
    • 13 months ago

    This is what I did, and I think I understand that it's better to return a shallow copy that mutate an existing array. However, I don't understand why the error happens. Can someone explain?

  • Custom User Avatar
    • AntCannon
    • commented on "Return the day " javascript solution
    • 17 months ago

    Super clean

  • Custom User Avatar
    • VPilikin
    • commented on "Sum Mixed Array" javascript solution
    • 3 years ago

    BETER BETTRE BETTERE

  • Custom User Avatar
    • koteykin007
    • commented on "Convert boolean values to strings 'Yes' or 'No'." go solution
    • 3 years ago

    it feels like overhead but still clever

  • Loading more items...
  • © 2025 Codewars
  • About
  • API
  • Blog
  • Privacy
  • Terms
  • Code of Conduct
  • Contact

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...