• 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
tomcusack1 Avatar
Name:Tom Cusack
Clan:University of Bath
Member Since:Jun 2016
Last Seen:Aug 2018
Profiles:
Following:41
Followers:36
Allies:36
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (26)
  • Replies
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • user1980686
    • commented on "Sum Strings as Numbers" javascript solution
    • 2 years ago

    It's a Double NOT bitwise operator. So~~undefined or ~~null becomes a 0.
    A more readable approach would be to just use a.pop() || 0

  • Custom User Avatar
    • newman-afk
    • commented on "Sum Strings as Numbers" javascript solution
    • 3 years ago

    Amazing!Love it

  • Custom User Avatar
    • jdold07
    • commented on "Sum Strings as Numbers" javascript solution
    • 3 years ago

    Thought the same thing. 0 + 0 was something I checked for before submitting, as I assumed it would have been tested given the need to eliminate leading zeros.

  • Custom User Avatar
    • jdold07
    • commented on "Sum Strings as Numbers" javascript solution
    • 3 years ago

    Because a and b are no longer strings. If you call a or b anytime after the split, you're referencing an array now, not the original string. Sounds like mutation to me.

    If you wanted to return a string indicating a written sum, like "11 + 11 = 22", you can't because you no longer have any way of accessing the original input of 11 and 11.

  • Custom User Avatar
    • kasir-barati
    • commented on "Sum Strings as Numbers" javascript solution
    • 3 years ago

    https://stackoverflow.com/a/5971668/8784518
    https://stackoverflow.com/a/32608094/8784518

  • Custom User Avatar
    • kasir-barati
    • commented on "Sum Strings as Numbers" javascript solution
    • 3 years ago

    What are those ~~?

  • Custom User Avatar
    • Vitaliy P
    • commented on "Sum Strings as Numbers" javascript solution
    • 3 years ago

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

  • Custom User Avatar
    • nkorostylev
    • commented on "Sum Strings as Numbers" javascript solution
    • 3 years ago

    I didn't understand the solution for first time. But it's perfect.

  • Custom User Avatar
    • EnverMT
    • commented on "Sum Strings as Numbers" javascript solution
    • 4 years ago

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

  • Custom User Avatar
    • SHBMFU003
    • commented on "Sum Strings as Numbers" javascript solution
    • 4 years ago

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

  • Custom User Avatar
    • HenriqueMisael
    • commented on "Sum Strings as Numbers" javascript solution
    • 4 years ago

    It is cool and clever, but it is FAR from best practices. The code isn't easily readable.

  • Custom User Avatar
    • thomas_a_anderson
    • commented on "Sum Strings as Numbers" javascript solution
    • 4 years ago

    Jesus Christ it's Jason Bourne

  • Custom User Avatar
    • Justletmein
    • commented on "Sum Strings as Numbers" javascript solution
    • 4 years ago

    The jealousy is strong here, lol. 'c' can easily stand for 'carry over' as that is exactly what it is used for. 'a' and 'b' are provided by the person who designed the kata in the first place, so that parts settled. 'res' could stand for 'residue', or 'residual', or wth cares. What even is this?

  • Custom User Avatar
    • Justletmein
    • commented on "Sum Strings as Numbers" javascript solution
    • 4 years ago

    The part that seems to be the crux is using remainders to compute a sum. I have never seen this. Very super duperly.

  • Custom User Avatar
    • littlebird217
    • commented on "Sum Strings as Numbers" javascript solution
    • 5 years ago

    This is cool

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

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...