• 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
CSandman Avatar
Name:Chris Sandvik
Clan:UVM
Skills:javascript, react, redux, sass, regex
Member Since:Apr 2015
Last Seen:Mar 2021
Profiles:
Following:24
Followers:22
Allies:22
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (20)
  • Replies
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • kikiondo117
    • commented on "String repeat" javascript solution
    • 9 months ago

    This is a solution but remember guys, the O notation for this is B(n * m) there's not better solution talking about Big o but we can use join or repat that internaly improve the performance. At the end the big o is B(n * m) but internaly we can improve a little bit the performance c:

  • Custom User Avatar
    • douseful
    • commented on "String repeat" javascript solution
    • 2 years ago

    Code formatting standards are indeed crucial!

  • Custom User Avatar
    • ins1der
    • commented on "String repeat" javascript solution
    • 3 years ago

    Good catch. This indentation is the classic example of horrible misleading.

  • Custom User Avatar
    • rsschool_1aff8f4b85661cec
    • commented on "String repeat" javascript solution
    • 3 years ago

    more logical when i=1; i<=n

  • Custom User Avatar
    • anasmak04
    • commented on "String repeat" javascript solution
    • 3 years ago

    the same code this answer is really clear and clean more practice than repeat

  • Custom User Avatar
    • jlubiba
    • commented on "String repeat" javascript solution
    • 3 years ago

    I like how different the answers are here. I like how you solved it.

  • Custom User Avatar
    • SOTASHE
    • commented on "String repeat" javascript solution
    • 3 years ago

    came up with the same. But I have used while loop instead

  • Custom User Avatar
    • Barak-code
    • commented on "String repeat" javascript solution
    • 3 years ago

    This is a straightforward solution.
    Just one change we need to change the var to let.
    Nowadays, the best practice is to use the let instead of var

  • Custom User Avatar
    • CharlesOrly
    • commented on "String repeat" javascript solution
    • 5 years ago

    oh right, still confused regarding that way of writing code. Thanks :)

  • Custom User Avatar
    • rbernanda
    • commented on "String repeat" javascript solution
    • 5 years ago

    That return actually outside the loop, because he didnt add {}. The loop without curly bracket only take one action.

  • Custom User Avatar
    • CharlesOrly
    • commented on "String repeat" javascript solution
    • 5 years ago

    nice, I came up with the same code.:D except the return is outside the loop

  • Custom User Avatar
    • K1ngMX
    • commented on "String repeat" javascript solution
    • 5 years ago

    yw :)

  • Custom User Avatar
    • Chreno972
    • commented on "String repeat" javascript solution
    • 5 years ago

    Yes, you are right, I've just forgot some peaces of that loop concept. Thanks for your reply.

  • Custom User Avatar
    • K1ngMX
    • commented on "String repeat" javascript solution
    • 5 years ago

    Hello,
    the "i" is not important to use, we just use it to loop for n-times :)

  • Custom User Avatar
    • Chreno972
    • commented on "String repeat" javascript solution
    • 5 years ago

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

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

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...