My English is not very good, but I will try to explain my question as simply as possible. Description: Alert result 1, I do not understand, I think it should be 2015 to warn.
var book = {}; Object.defineProperties(book, { _year: { value: 1 }, edition: { value: 23 }, year: { get: function () { return this._year; }, set: function (newValue) { if (newValue > 2004) this._year = newValue; } } } ); book.year = 2015; alert(book.year);
javascript
xina1i
source share