Advertisement
AbdulMuttaqin

Untitled

Jan 15th, 2021
531
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.10 KB | None | 0 0
  1. function getMiddle(s) {
  2. return s.substr(Math.ceil(s.length / 2 - 1), s.length % 2 === 0 ? 2 : 1);
  3. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement