Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. > Hi everyone,
  2. > I am trying to figure out how to remove part of an ID from an array item?
  3. > Thanks for the help!
  4. @jen188#6518
  5. `let array = ['ID1', 'ID2'];
  6. let index = 0
  7. let id = array[index];
  8. id = id.substring(0,2)
  9. array[index] = id`
  10. Look here if yoy have a question about the `id.substring` part: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring
  11. I hope I could help you!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement