Monday, February 2, 2015

Print all functions defined in window in JavaScript

To print all function defined in window in JavaScript,

use the following code:

    for (var propertyName in this) {
        var property = this[propertyName];
        if (typeof(property) === 'function') {
            console.log(property);
        }
    }

Reference:
http://stackoverflow.com/questions/152483/is-there-a-way-to-print-all-methods-of-an-object-in-javascript

No comments:

Post a Comment