constevenOrOdd=(str)=>{constevenCount=(`${str}`.match(/[02468]/g)||'').length,oddCount=(`${str}`.match(/[13579]/g)||'').length;return(evenCount===oddCount)?'Even and Odd are the same':(evenCount>oddCount)?'Even is greater than Odd':'Odd is greater than Even';};
Log in to continue
We're a place where coders share, stay up-to-date and grow their careers.
My solution in js