JSFiddle - React, Tailwind, and code Playground

JavaScript

// I want to output new Date().getDate()
// But getDate is inside a string

fn = "getDate"
d = new Date();


// How do I make it work?
console.log(d[fn]());