• 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
hutstep Avatar
Name:Stephan
Clan:Unknown
Member Since:Sep 2016
Last Seen:Nov 2016
Profiles:
Following:0
Followers:1
Allies:0
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (5)
  • Replies
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • xehpuk
    • commented on "Delete occurrences of an element if it occurs more than n times" javascript solution
    • 7 years ago

    It in fact isn't possible. The numbers are automatically converted into strings.

  • Custom User Avatar
    • nasdav2
    • commented on "Consecutive strings" javascript solution
    • 9 years ago

    In fact I was caought up here too thinking the same thing, the answer is simple : it's about " Operator precedence "
    you've been thinking of that expression like this :

    return ( i+k > a.length ) || ( s.length >= a.slice(i,i+k).join('').length ? s : a.slice(i,i+k).join('') );

    In fact it is interpreted like this

    return ( i+k > a.length || s.length >= a.slice(i,i+k).join('').length ) ? s : a.slice(i,i+k).join('');

    Because the || operator take precedence over the ? operator

  • Custom User Avatar
    • ivorscott
    • commented on "Delete occurrences of an element if it occurs more than n times" javascript solution
    • 9 years ago

    I've been there..

  • Custom User Avatar
    • hutstep
    • commented on "Consecutive strings" javascript solution
    • 9 years ago

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

  • Custom User Avatar
    • hutstep
    • commented on "Delete occurrences of an element if it occurs more than n times" javascript solution
    • 9 years ago

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

  • © 2025 Codewars
  • About
  • API
  • Blog
  • Privacy
  • Terms
  • Code of Conduct
  • Contact

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...