//codewars:Get the Middle Character
function getMiddle(str)
{
let length = str.length
if(length <=0 || !str)return ""
if(length%2==0){
var result = str.charAt(Math.floor(length/2)-1)+str.charAt(Math.floor(length/2))
}else var result = str.charAt(Math.floor(length/2))
return result
}