Ad
  • Custom User Avatar

    No you aren't. For one, there is no global variable to modify because result is initialized and mutated inside of the function. Second, strings are immutable. This isn't modifying the string, its appending to a non-related list at specific slices of the string. . It is imperative code though, if that is what you meant. This can be written functionally but in this case, the imperative definitely seems more readable.