Eduardo Serrano
Eduardo Serrano

Reputation: 31

I get the error SCRIPT1003: Expected ':' in IE 11; (Java Script Code error)

This particular snippet of JS code does not work on IE 11. I get the error SCRIPT1003: Expected ':' and it says it is missing on line that it's in bold.

var $actions = application.service('$actions', [
function() {
    let _logout = function() {
        $('#logoutForm').submit();
    }
    return {
        **Logout() {**
            _logout();
        },
    };
}]);

Any ideas? Thank you

Upvotes: 0

Views: 3076

Answers (1)

ASDFGerte
ASDFGerte

Reputation: 5193

IE11 does not support shorthand method names. See the compatability part of the MDN. Use

return {
   Logout: function() {
       _logout();
   }
};

(or stop supporting internet exploder, if you have the opportunity to - it causes a lot of headache)

Upvotes: 1

Related Questions