vendredi 17 novembre 2017

Date's prototype methods are not enumerable. How to obtain a list of them to iterate?

I want to iterate over the methods of a javascript Date object. The first attempt did not work:

var date = new Date();
for (var key in date) {
    console.log(key);
}

I've tried a few related things -- Object.keys, for example. So far I have not found a way to do it.





Aucun commentaire:

Enregistrer un commentaire