Ad
  • Custom User Avatar
  • Custom User Avatar

    Could you clarify your question a bit more?

    how to push a character in one string into another string

    Push character where? At the end? In the middle? One is easy, other is impossible.

    Strings are immutable, so you can't 'insert' a character in the middle, but you can construct a new string using concatenation, string interpolation or whatever.

    If you want to change characters in middle, it's sometimes better to work with arrays.

  • Custom User Avatar

    About how to post code properly (and more useful things), read this: https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution

    About not being sure how to work with prototype, try searching for it in MDN docs, or some other reliable source. Note that the tests don't use parameters, so prototype works differently than a common function.