Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getMiddle(s) {
- return s.substr(Math.ceil(s.length / 2 - 1), s.length % 2 === 0 ? 2 : 1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement