• 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
Shellby Avatar
Name:Alexander
Clan:Unknown
Member Since:Feb 2017
Last Seen:Nov 2022
Profiles:
Following:5
Followers:4
Allies:2
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (66)
  • Replies
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • 23Ruslan
    • commented on "Basic Mathematical Operations" javascript solution
    • 9 months ago

    This is a very interesting way to use the concept of an object in JavaScript!

  • Custom User Avatar
    • introverted_nomad
    • commented on "Basic Mathematical Operations" javascript solution
    • 10 months ago

    So cool bro

  • Custom User Avatar
    • browynlouis
    • commented on "Basic Mathematical Operations" javascript solution
    • 10 months ago

    No, it actually calls all 4 operations, due to the fact that the object initialization has to resolve it's properties during runtime

    so by calling cases[operation], you're just returning 1 of 4 already calculated operations

  • Custom User Avatar
    • emmanias
    • commented on "Basic Mathematical Operations" javascript solution
    • 11 months ago

    impressive

  • Custom User Avatar
    • aliahmadCode
    • commented on "Basic Mathematical Operations" javascript solution
    • 13 months ago

    Very clever

  • Custom User Avatar
    • Java17
    • commented on "Basic Mathematical Operations" javascript solution
    • 13 months ago

    yeah

  • Custom User Avatar
    • Java17
    • commented on "Basic Mathematical Operations" javascript solution
    • 13 months ago

    Impressive)))))))))

  • Custom User Avatar
    • JakeyDonkeyBrains
    • commented on "Basic Mathematical Operations" javascript solution
    • 14 months ago

    i saw some folks saying this runs all 4 operations but that isnt true right? the key [operation] is defining the condition for the code block within cases resulting in only the code matching the condition being executed? Essentially replacing switch(operation) if i understand it correctly.

  • Custom User Avatar
    • HumbertoDevelop
    • commented on "Basic Mathematical Operations" javascript solution
    • 16 months ago

    Interesting way.

  • Custom User Avatar
    • Ovando21
    • commented on "Basic Mathematical Operations" javascript solution
    • 17 months ago

    I was doing 'case' and it was appearing an error curious why this was happening but when puttting 'cases' it appeared correct?

  • Custom User Avatar
    • o2001
    • commented on "Minimize Sum Of Array (Array Series #1) " javascript solution
    • 2 years ago

    Yeah; in fact, this particular approach relies on that.

  • Custom User Avatar
    • mo.mo.
    • commented on "Minimize Sum Of Array (Array Series #1) " javascript solution
    • 2 years ago

    it will change the input array :)

  • Custom User Avatar
    • Lemarczini21
    • commented on "Basic Mathematical Operations" javascript solution
    • 2 years ago

    Clever, great!

  • Custom User Avatar
    • carlsagan
    • commented on "Basic Mathematical Operations" javascript solution
    • 2 years ago

    Object Literal?

  • Custom User Avatar
    • RandomChase
    • commented on "Basic Mathematical Operations" javascript solution
    • 3 years ago

    Edit: Oh wait, it is actually operating the other 3 as well, even if they are not selected? XD JS is weird.

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

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...