the below code is written in javascript, is it possible to convert the same code into JSP by using the expression tag <% %>.
var d3="${docbean.dateStartDate}";
var d4="${docbean.dateEndDate}";
const d1 = new Date(d3);
const d2 = new Date(d4);
var months;
months = (d2.getFullYear() - d1.getFullYear()) * 12;
months -= d1.getMonth();
months += d2.getMonth();
months=months+1;
const d6=new Date(2021, 11, 0).getDate();
document.getElementById("demo1").innerHTML months+d6;
If there are any other means of converting the above javascript code to JSP, then pls let me know the process. Thanks.