getmonth() returns the month as code example
Example 1: javascript month name
let date = new Date(2020, 05, 21);
let longMonth = date.toLocaleString('en-us', { month: 'long' });
let shortMonth = date.toLocaleString('en-us', { month: 'short' });
let narrowMonth = date.toLocaleString('en-us', { month: 'narrow' });
Example 2: Javascript get month name
var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
var d = new Date();
var monthName=months[d.getMonth()];
Example 3: javascript getmonth
new Date().getMonth();
Example 4: getmonth javascript
var date=new Date();
var month=new Array();
month[0]="January";
month[1]="February";
month[2]="March";
month[3]="April";
month[4]="May";
month[5]="June";
month[6]="July";
month[7]="August";
month[8]="September";
month[9]="October";
month[10]="November";
month[11]="December";
var n = month[date.getMonth()];
Example 5: 3 letter months javascript array
var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
var today = new Date();
var d = today.getDate();
var m = months[today.getMonth()];
var y = months.getFullYear();
console.log(d + "-" + m + "-" + y);