How to skip double ; and omit last ; from string;
function myFunction() {
  var str = "how;are;you;;doing;";
  var res = str.split(";");
  console.log(res[3]);
  console.log(res);
}
myFunction();it should return how,are,you,doing
should be like console.log(res[3]) = it should says doing not blank
 
     
     
     
     
     
     
    