Ad
  • Custom User Avatar
  • Default User Avatar

    Thank you, that helps a lot! :)
    I meant to ask about adding some character onto the end of a string using .push(). The idea is to push 'r' onto the end of 'doo' and have 'door' as a result.
    For my code to work, I'd have to be able to push, say, 'rs' onto 'doo' as well.
    To what you said: I'm learning about how to split strings into arrays, I think doing so will make it much easier for me.

  • 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.

  • Default User Avatar

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

  • Default User Avatar

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

  • 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.

  • Default User Avatar

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

  • Default User Avatar

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