Why does my “next” property disappear in my JavaScript hash in Firefox 3.6

I create a hash as an options object to go to the jQuery plugin. One of the keys I need to use as defined by the plugin is next.

This works fine in Safari (so I assume Webkit in general), but in Firefox they remove it, or ignore it, or something ... it just doesn't exist. For instance:

var opts = {
  "next": "some selector string",
  "prev": "some other selector string",
  "anotherOption": 1
};

console.log(opts);

Ouput:

anotherOption      1
prev               "some other selector string"

It drives me crazy. What more, there are many plugins and things that use this key name in hashes of a certain type, and I have never noticed this behavior before. Can someone tell me what is going on here and how it works? (I tried to do it opts.next = "something", but it gives the same result).

- ( console.log) Firebug .

+3
2

Firebug, . Firebug, JS. .

>>> var v = {};
undefined
>>> v.next = 'foo';
"foo"
>>> v.prev = 'bar';
"bar"
>>> v
Object { prev="bar"}
>>> v.next
"foo"
+3

Firefox.

Firebug , - next, .

+4

Source: https://habr.com/ru/post/1796569/


All Articles