简体   繁体   中英

Which browsers support bind()?

I have to use bind() in the method below. I only want to support IE10 and up. Can anyone verify when or if bind() is supported by IE10?

    // Verify console exists
    ...    
    if (window.console) {
        logger = window.console.log.bind(window.console);
        // bind needed for Safari but not FF, possible IE issue?
    } else {
        return false; // window.console not available, silent fail
    }
    ...

bind has been supported in IE since version 9 . Take a look at this compatibility table, linked from the MDN docs for bind : http://kangax.github.com/es5-compat-table/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM