print date with month in javascript code example
Example: how to write a program that alerts the current month in words in javascript
var currentDate = new Date();
currentDate.toString;
var b = currentDate.toString();
var c = b.slice(4,7);
if (c === "Jan"){
document.write("Current month: January")
}else if(c === "Feb"){
document.write("Current month: February")
}else if(c === "Mar"){
document.write("Current month: March")
}else if(c === "Apr"){
document.write("Current month: April")
}else if(c === "May"){
document.write("Current month: May")
}else if(c === "Jun"){
document.write("Current month: June")
}else if(c === "Jul"){
document.write("Current month: July")
}else if(c === "Aug"){
document.write("Current month: August")
}else if(c === "Sep"){
document.write("Current month: September")
}else if(c === "Oct"){
document.write("Current month: October")
}else if(c === "Nov"){
document.write("Current month: November")
}else if(c === "Dec"){
document.write("Current month: December")
}