0

This works just fine in chrome/firefox, but fails in IE 9. How can I do this correctly?

var Wrapper = function ()
{
  this.loc = {};
  this.loc.default = {};   // fails here in IE
  this.loc.default.lat = 30;
  this.loc.default.lon = -120;
};

2 Answers 2

3

https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Reserved_Words maybe it is due to that default is reserved keyword in JS

did you try with another instead of default

Sign up to request clarification or add additional context in comments.

Comments

0

default is a reserved word. Try calling it something else.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.