• 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
ringmaker Avatar
Name:Ringmaker
Clan:#100Devs - leonnoel.com/twitch
Member Since:May 2022
Last Seen:Nov 2024
Profiles:
Following:488
Followers:488
Allies:488
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (11)
  • Replies
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • ringmaker
    • commented on "Does my number look big in this?" javascript solution
    • 2 years ago

    What the map is doing in this example is taking the current element (x), the index of the current element (i), and the array that .map was called upon (arr) - the x, i, and arr are just variables that you can name whatever you wish but they will always reprsent the element, index, array in that order. Sometimes you only want the array when using a map, but the only way to do that is to include the element and index regardless.

    However if you only need the element you can write something as simply as .map((x) => x ** num), ignoring the index and array.

    You can read more about it on the MDN here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map

  • Custom User Avatar
    • ramacode1980
    • commented on "Kata Example Twist" javascript solution
    • 3 years ago

    LOOL! My exact thoughts! Very efficent!

  • Custom User Avatar
    • ringmaker
    • commented on "Who likes it?" javascript solution
    • 3 years ago

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

  • Custom User Avatar
    • ringmaker
    • commented on "Remove anchor from URL" javascript solution
    • 3 years ago

    WOW, this is so simple and I love it. Gonna have to write this one down.

  • Custom User Avatar
    • ringmaker
    • commented on "Kata Example Twist" javascript solution
    • 3 years ago

    damn I gotta put this in anki so I can learn to code better, my solution seems inneficient

  • Custom User Avatar
    • ringmaker
    • commented on "Mumbling" javascript solution
    • 3 years ago

    the map() method can take in several parameters, .map(element, index, array), in this case c is the element and i is the index. You can call them anything you'd like rather than c or i, but they always represent the same thing in .map()

    The Mozilla MDN has a great page on it so you can get a better feel for it. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map

  • Custom User Avatar
    • ringmaker
    • created a suggestion for "Ninja vs Samurai: Strike" kata
    • 3 years ago

    In Javascript, the tests do not allow for "private" variables (such as using a _ or #) so nobody can unintentionally alter the class. Seems suitable to add to a 7kyu.
    This one was pretty fun though!

  • Custom User Avatar
    • ringmaker
    • commented on "Create Phone Number" javascript solution
    • 3 years ago

    Genuinely genius, I feel silly for mine now! lmao

  • Custom User Avatar
    • Chrono79
    • resolved an issue on "Count of positives / sum of negatives" kata
    • 3 years ago

    That is a problem with your code, not a kata issue. Read the error message, rethink the order you use to do things in your code.

  • Custom User Avatar
    • Fob0s96
    • created an issue for "Count of positives / sum of negatives" kata
    • 3 years ago

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

  • Custom User Avatar
    • ringmaker
    • created a question for "Count of positives / sum of negatives" kata
    • 3 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...