const getMiddle = (s) => {
if (s.length % 2 === 0) {
return s.substring(s.length / 2 - 1, s.length / 2 + 1);
} else {
return s.substring(s.length / 2, s.length / 2 + 1);
}
};
console.log(getMiddle("abbc"));
console.log(getMiddle("abc"));