Skip to content

Instantly share code, notes, and snippets.

@bmarcot
Created June 21, 2019 15:03
Show Gist options
  • Save bmarcot/bb05627b79f03781d71ada53b7c03f5d to your computer and use it in GitHub Desktop.
Save bmarcot/bb05627b79f03781d71ada53b7c03f5d to your computer and use it in GitHub Desktop.
const insertAt = (str, sub, pos) => {
return str.substring(0, pos) + sub + str.substring(pos);
}
console.log(insertAt("I want apple", " an", 6));
@bmarcot
Copy link
Author

bmarcot commented Jun 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment