Create options with Constructor (JavaScript)
问题 What I want to know How to also apply the constructor to DOMs.selectTimes . More efficient ways to clean up my code What my code is for I made a script which creates option elements for HTML forms dynamically. I could apply birthYear/birthMonth/birthDay to a constructor. But I can't do it for selectTimes . How can I do it? OR are there any more efficient ways? Here is my code (function() { /* Fetch DOMs */ const DOMs = { selectYear: document.querySelector('#select-birthyear'), selectMonth: