how to get all months in angular code example
Example: get the name of month without using hard coded arrays in javascript
//Assume that cuurent month is December results are given
var getmonth = new Date().toLocaleString("en-us", { month: "short" });
console.log(getmonth);
//result =Dec
var getmonth = new Date().toLocaleString("en-us", { month: "long" });
console.log(getmonth);
//result= December
var getmonth = new Date().toLocaleString("en-us", { month: "narrow" });
console.log(getmonth);
//result=D