how to get current month in express js

const express = require('express');
const app = express();

app.get('/currentMonth', (req, res) => {
  const currentDate = new Date();
  const currentMonth = currentDate.getMonth() + 1;

  res.json({ currentMonth });
});

const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
  console.log(`Server is running on port ${PORT}`);
});